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

Need of cisc cpu - computer architecture, Need of CISC CPU -  computer arc...

Need of CISC CPU -  computer architecture: Why is Intel spending money and time to manufacture the Pentium II and the Pentium III? The answer of this question is simple, ba

Electrically erasable programmable rom - computer memory, Explain Electrica...

Explain Electrically Erasable Programmable ROM - Computer Memory? The next level of erasability is the EEPROM which able to be erased under software control. This is the most f

What do you mean by execution unit, Q. What do you mean by Execution Unit? ...

Q. What do you mean by Execution Unit? Execution unit performs all ALU operations. Execution unit of 8086 is of 16 bits. It also contains the control unit that instructs bus in

create a class called auditorium, Create a class called auditorium that sp...

Create a class called auditorium that specifies the seats in the auditorium. The class should include at least one data item: seat (two dimensional array of Char) and at least thre

What is datapool, A datapool is a source of variable test data that scripts...

A datapool is a source of variable test data that scripts can draw from during playback

State the use of erasable programmable read only memory, Erasable programma...

Erasable programmable read only memory (EPROM) This is a special type of PROM which can be erased by exposing it to ultraviolet (UV) light. Once it has been erased, it can be r

Basic logic gates, Basic logic gates Introduce the basic logic gates i...

Basic logic gates Introduce the basic logic gates in terms of a) their function, b) their circuit symbol, c) their truth table and d) their equivalent in Boolean a

What is computer to computer communication, Computer to computer communicat...

Computer to computer communication is: (A)  Simplex                                   (B)  Duplex (C)  Half Duplex                             (D)  Both Duplex and Half D

C program, Write a program to find the area under the curve y = f(x) betwee...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

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