c++, 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:- c++

Explain the techniques used for protection of user files, Explain the techn...

Explain the techniques used for protection of user files. This is easier to protect against accidental than malicious misuse. Protection of user files implies that file owne

Illustrate working of J-K flip-flop, Q. Illustrate working of J-K flip-flop...

Q. Illustrate working of J-K flip-flop? J-K flip-flop is also a modification of SR flip-flop since it has 2 inputs same as S and R and all possible inputs combinations are vali

Is strategy - information system, IS strategy - Information System As ...

IS strategy - Information System As an operations manager when attempting to navigate your organisation through the information landscape and make best use of the available sy

What are the various components in sequence diagrams, ? Actor: Actor shows ...

? Actor: Actor shows an external user / end user who interact with the system. ? Object: Object is shown by one of components of the system. ? Unit: A unit is a subsystem, o

Describe the role of software developers, Describe the role of Software dev...

Describe the role of Software developers Software developers have wide experience of tackling such issues. Students who develop software project spending days and nights strug

What are the features of cisc processors, What are the Features of CISC Pro...

What are the Features of CISC Processors The standard features of CISC processors are listed below:  CISC chips have a large amount of dissimilar and complex instructions.

Compare putchar function with the getchar function, Normal 0 fa...

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

What is java applet, A Applet is a java program that runs within a web brow...

A Applet is a java program that runs within a web browser.

Explain grade of service with reference to telephone traffic, With referenc...

With reference to telephone traffic, explain the terms GOS. GOS: in loss systems, the traffic carried through the network is usually lower than the actual traffic offered to

Analysts in telecommunications area, Q. Analysts in Telecommunications area...

Q. Analysts in Telecommunications area? Here computer networks which play a critical role in success of any business are designed, implemented and managed. Here Network analyst

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