The Polishing Game, C/C++ Programming

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Necklaces require polishing the jewels. Operationally, all jewels of the same colour can be polished in one sitting.

Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed from the necklace, all other jewels of the same colour are assumed to be removed for polishing from the necklace. The player who polished the most jewels, wins. Damjibhai being more senior, always gets a chance to play first (remove jewel from necklace first). If both players play optimally, find out if Damjibhai can win. The following are the rules of their game

Jewels can only be removed for polishing from either end of the necklace (i.e. head or tail)
Once a jewel type is removed from the necklace, all other instances of the same jewel type is treated as polished by the person who removed the jewel
For purpose of this problem, we have represented the necklace as a string and each character of the string is a Luminous Jewel


Input Format:

First line starts with T, number of test cases. Each test case T contains a necklace (N).

Output Format:

Print "Yes" if Damjibhai can win, else print "No".
Posted Date: 8/14/2014 1:46:49 AM | Location : USA







Related Discussions:- The Polishing Game, Assignment Help, Ask Question on The Polishing Game, Get Answer, Expert's Help, The Polishing Game Discussions

Write discussion on The Polishing Game
Your posts are moderated
Related Questions
A: you can exploit by overloading standard operators on a class, the intuition of the users of that class. This allow users program in the language of the problem domain instead of

Suppose that three integer variables intA, intB, and intC have already been defined at the beginning of the main function, write a single C++ statement to read three integers from

write a program for convert numbers upto 9 to alphabet?Eg.now enter the inputis 666 means output is "0" lphabet

Is there any difference between List x; and List x ()? Can you please provide me assignment help.

who to write max if statements in a program

Default Arguments A default argument is a value that is automatically assigned to a formal variable, if the actual argument from the function call is omitted. e.g. void

Implementing files in c++

Abstraction is of the process of hiding unwanted details from the user

In the final project assignment you are asked to develop an OOP C++ class hierarchy for derivative pricing, using the binomial tree and Black-Scholes option pricing methods. You wi