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 do you recognize the performance bottlenecks, Performance Bottlenecks c...

Performance Bottlenecks can be identified by using monitors. These monitors might be application server monitors, database server monitors, web server monitors and network monitors

What are benefits to businesses by e-commerce over extranets, What are adva...

What are advantages and benefits to businesses by e-commerce over extranets? The advantages and benefits to businesses comprise: Less Paperwork: along with documents and bus

Using bit wise operator implement nor and nand gate, Q. Write a program t...

Q. Write a program to implement NOR, NAND, XOR and XNOR gates using and without using bit wise operator. Also perform necessary checking. The user has option to give n numbe

Explain the terms topology used in lans, Explain the terms topology used in...

Explain the terms topology used in LANs. (i) LAN topologies: This network topology is a physical schematic that shows interconnection of the several users. There are four fun

What do you mean by best fit, What do you mean by best fit?  Best fit a...

What do you mean by best fit?  Best fit allocates the smallest hole that is big enough. The whole list has to be searched, unless it is sorted by size. This method makes the sm

By which all systems are identified, In a LAN network every system is ident...

In a LAN network every system is identified by? In a LAN network all systems are identified through IP Address.

What is the role of certifying authority, What is the Role of Certifying Au...

What is the Role of Certifying Authority? A certificate authority is a body, that is either public or private, that seeks to fill the requirement for trusted third-party servic

Quantity amounts (data type quan), A field containing quantity amounts (dat...

A field containing quantity amounts (data type QUAN) must be assigned to a reference table and a reference field. Explain? As a reference table, a system table having all the v

What are the advantages of using structure in c program, What are the advan...

What are the advantages of using structure in C Program Declaring a struct is a two-stage process. The first stage defines a new data type that has the required structure which

Define dynamic loading, Define dynamic loading. To get better memory-sp...

Define dynamic loading. To get better memory-space utilization dynamic loading is used. With dynamic loading, a routine is not loaded unless it is called. All routines are kept

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