Luminous Jewels - The Polishing Game, Computer Engineering

Assignment Help:
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".

Constraints:

1<=T<=100

1<=|N|<=500, N will only contain lower case alphabets (''a''-''z'').



Related Discussions:- Luminous Jewels - The Polishing Game

Define mfc, Define MFC. To accommodate the variability in response time...

Define MFC. To accommodate the variability in response time, the processor waits unless it receives an indication that the requested read operation has been done. The control s

Illustrate layout of magnetic disk, Q. Illustrate Layout of Magnetic Disk? ...

Q. Illustrate Layout of Magnetic Disk? Head is a relatively small device capable of reading from or writing to a part of platter rotating beneath it. This gives rise to organiz

What is the semiconductor memory chip, What is the Semiconductor memory chi...

What is the Semiconductor memory chip A semiconductor memory chip comprises a large number of cells organized into an array and the logic necessary to access any array in the c

Explain the working of a 2-bit digital comparator, Explain the working of a...

Explain the working of a 2-bit digital comparator with the help of Truth Table. Ans. Digital comparator is a combinational circuit which compares two numbers, A and B; and

Show system call for cloning, Show System call for cloning.  Standard f...

Show System call for cloning.  Standard form of Clone function is as follows: Int clone (Int (*FN) (), void *child stack, Int flag, intargs,); Parameter FN is Pointer fro

What decision has the highest expected value, The Prisoner's Dilemma is a w...

The Prisoner's Dilemma is a well-known problem in game theory. Two thieves are arrested and held in custody separately. The police offer each the same deal. Inform on your partn

By which the speech of side tone is heard, Side tone is the speech heard by...

Side tone is the speech heard by (A)  the receiving subscriber (B)  both the receiving and calling subscriber (C) by on looker (D) by calling subscriber Ans

Smallest and largest integer , A given microprocessor has words of 1 byte. ...

A given microprocessor has words of 1 byte.  What is the smallest and largest integer that can be characterized in the following representations?   a) unsigned b) sign- ma

Control flow diagram, creating a control flow question for atm system

creating a control flow question for atm system

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd