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

How can we design radio button, Q. How can we design Radio Button? Radi...

Q. How can we design Radio Button? Radio buttons are used when only one out of group of options is to be chosen. In the illustration code we have put a line break after every b

Define virtual memory, Normal 0 false false false EN-IN...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Software engineering, specialization,ggeneralization and aggregation of rai...

specialization,ggeneralization and aggregation of railway reservation system?

Explain a multiprogramming operating system, Explain a multiprogramming ope...

Explain a multiprogramming operating system? A multiprogramming operating system: It is system which allows more than one active user program or part of user program to be st

Balance - principles of composition, Balance The balance of an image ca...

Balance The balance of an image can be thought of as the distribution of visual weight within the piece. A piece of art can be structured so that the elements create a sense of

Determine the o/p for JK flip flop with J=1 & K=0, For JK flip flop with J=...

For JK flip flop with J=1, K=0, the output after clock pulse will be ? Ans. The output will be 1 after clock pulse.

What are the four factors of open source software, What are the four signif...

What are the four significant factors that led to the development of open source software? 1. To diminish the high control value of the Proprietary Software 2. To avoid disc

What is a sap system, What is a SAP system? The union of all s/w compo...

What is a SAP system? The union of all s/w components that are assigned to the similar databases is known as a SAP system.

Application layer in tcp/ip model corresponds to for what, Application laye...

Application layer (layer 4) in TCP/IP model corresponds to? In OSI model, application layer (layer 4) in TCP/IP model corresponds to layer 6 and layer 7.

Name at least six file extensions of microsoft access, Some of the file ext...

Some of the file extensions present in MS Access are ? Access blank project template .adn ? Access database .accdb ? Access Workgroup .mdw ? Access project .adp ? A

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