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

Explain activities of an operating system, List the major activities of an ...

List the major activities of an operating system with respect to memory management, secondary storage management and process management. Operating system is causes for followin

Difference between data warehousing and data mining, What is the difference...

What is the difference between data warehousing and data mining? The dissimilarity between data warehousing and data mining: Data warehousing seems to the data storage wh

State about the object models, State about the Object models Object mo...

State about the Object models Object models are used for explaining the objects in the system and their connection with each other in the system. The dynamic model explains in

What are privileged instructions, What are privileged instructions?  So...

What are privileged instructions?  Some of the machine instructions that might cause harm to a system are designated as privileged instructions. The hardware permits the privil

What is efi framework, The Extensible Firmware Interface (EFI) is a specifi...

The Extensible Firmware Interface (EFI) is a specification that defines a software interface among an operating system and platform firmware. EFI is intended as a significantly imp

Logical representations in artificial intelligence, Logical Representations...

Logical Representations: If every human being spoke the same kind of language, there would be several less misunderstanding in the world. The problem with software engineering

Define baud rate, Define baud rate The rate of data transfer in serial...

Define baud rate The rate of data transfer in serial data communication is signified in bps. Bits per second (bps) is the rate of transfer of information bits. Baud is the num

Explain the paging unit, Explain the Paging Unit Paging mechanism funct...

Explain the Paging Unit Paging mechanism functions with 4K - byte memory pages or with a new extension available to Pentium with 4M byte-memory pages. In Pentium, with new 4M-b

Name some of synthesizable and non-synthesizable constructs, Can you list o...

Can you list out some of synthesizable and non-synthesizable constructs? not synthesizable->>>> initial ignored for synthesis. delays  ignored for synthesis. ev

What are the major functions of io system, What are the major functions of ...

What are the major functions of IO system?  i. Interface to the CPU and memory by the system bus.  ii. Interface to one or more IO devices by tailored data link.

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