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

Define user mode and kernel mode, Define user mode and Kernel mode Kern...

Define user mode and Kernel mode Kernel is a private mode in that no limitation is imposed on the kernel of system. Kernel may be use all the information of the processor, oper

State the approaches to organizing stored program control, Determine the ap...

Determine the approaches to organizing stored program control There are 2 approaches to organizing stored program control: 1.  Centralized: In this control, all control equi

How is a multidimensional array defined pointer, How is a multidimensional ...

How is a multidimensional array defined in terms of a pointer to a collection of contiguous arrays of lower dimensionality ? C does not have true multidimensional arrays. Howev

Describe in brief the history of e-commerce, Describe in brief the history ...

Describe in brief the history of E-Commerce.  History of E-commerce. E-commerce started before personal computers were prevalent and has grown into a multi-billion d

What is a service in sap terminology, What is a Service in SAP terminology?...

What is a Service in SAP terminology? A service refers to something offered by an s/w component.

Phython, super ascii string checker

super ascii string checker

Logic gates required to build a half adder, What are the gates required to ...

What are the gates required to build a half adder ? Ans. The gates needed to build a half adder are EX-OR gate and AND gate as shown below the logic diagram of half adder:

By which analog signal combine with a carrier frequency, Analog signals can...

Analog signals can be              by combining them with a carrier frequency (A)  Carried                                      (B)  Transported (C)  Multiplexed

How the characters used in operand data type, Q. How the Characters used in...

Q. How the Characters used in operand data type? A common form of data is character or text strings. Characters are signified in numeric form mostly in ASCII (American Standard

Give the solutions for critical section problem, Give the solutions for cri...

Give the solutions for critical section problem? A solution to the critical section problem must specify the subsequent requirements. (a) Mutual exclusion (b) Progress (c)

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