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

Enumerate the history of computers, Enumerate the History of computers ...

Enumerate the History of computers Basic information about technological development trends in computer in past and its projections in future. If you want to know about compute

What is computer virus, What is computer virus?  A  computer  virus  is...

What is computer virus?  A  computer  virus  is  a  computer  program  that  is  designed  to  spread  itself between   computers.   Computer virus are inactive when standing a

Contact-based keyboards, Contact-based keyboards employ switches directly. ...

Contact-based keyboards employ switches directly. Though they have a comparatively shorter life they are the most preferred type these days because of their lower cost.  Three such

What is called network, Network with point-to-point link is known as (...

Network with point-to-point link is known as (A) Fully Connected Network        (B)  Half Connected Network (C)  Duplex Connected Network    (D)  None of these Ans:

Algorithm to have a good best case running time, How can we change almost a...

How can we change almost any algorithm to have a good best case running time? Check whether the input constitutes an input at the very starting Or else run the original algo

How call processing takes place, How call processing takes place? Fund...

How call processing takes place? Fundamental Call Procedure: Fig. demonstrates a simplification diagram exemplifying how two telephone sets (as subscribers) are interconnecte

Data structure, How does dynamic memory allocation help in managing data

How does dynamic memory allocation help in managing data

Hazard, how to calculate delay for hazard?

how to calculate delay for hazard?

What is typical storage hierarchy, Q. What is typical storage hierarchy? ...

Q. What is typical storage hierarchy? A typical storage hierarchy is displayed in Figure above. Though Figure shows only block diagram however it includes storage hierarchy:

Differentiate between qa and testing, Differentiate between QA and testing....

Differentiate between QA and testing. - Quality Assurance is more a stop thing, ensuring quality in the company and thus the product rather than just testing the product for so

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