programming, JAVA Programming

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:- programming

What is the use of forwardaction, Normal 0 false false fals...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Area under curve., write a program to find the area under the curve y=f(x) ...

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.   #include float start_point,

Elaborate with examples vector or object oriented graphics, Elaborate with ...

Elaborate with examples Vector or Object oriented graphics? Vector or Object-Oriented Graphics treats everything which is drawn as an object. Objects retain their identity afte

How to write exception subclasses, How to Write Exception Subclasses ? ...

How to Write Exception Subclasses ? Most exception subclasses inherit all their functionality from the superclass. Each subclass majorly serves as a marker for a various types

Explain ftp-telnet-voip and instant messaging, Write a brief note on each o...

Write a brief note on each of the following. FTP Telnet Instant messaging VoIP FTP: File Transfer Protocol: This protocol is used to upload and download the

Determine about the runtime security manager, Determine about the runtime S...

Determine about the runtime Security Manager Java also has a runtime Security Manager can check which operations a specific piece of code is allowed to do. Consequently, java c

What is a local member and a class variable, What is a local, member and a ...

What is a local, member and a class variable? Variables declared within a method are "local" variables. Variables declared within the class i.e not within any methods are "m

About state and behavier of two different object, two different object may...

two different object may have chance to have same behavier but property must be different why?

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