programming, JAVA Programming

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'').
Posted Date: 8/14/2014 2:55:02 AM | Location : USA







Related Discussions:- programming, Assignment Help, Ask Question on programming, Get Answer, Expert's Help, programming Discussions

Write discussion on programming
Your posts are moderated
Related Questions
How much CPU time does an applet get? One of the few legitimate concerns about hostile applets is excessive use of CPU time. It is possible on a non-preemptively multitasking s

In this assignment you work on a set of tasks with the classes Currency, Money and Bank. Money and Currency You have been given a template for the Currency and Money classes (Lab1.

Create an online multiple-choice quiz using JSP/Servlets technology. The quiz should draw questions from an array of predefined questions (at least fifteen). You should use a meani

What happens to the static fields of a class during serialization? There are three exceptions in which serialization does not necessarily read and write to the stream. These


In JavaScript, what is event handling? What are the two categories of events? In java script we could capture events on do a few operation on the basis of which particular even

Overview Demonstrate your knowledge of JavaScript and ColdFusion by implementing the following functionality: Contact form • The following validation error message shou

Write a ComputerPart class and a ComputerKit class and a client class to test them. The ComputerPart class has two variables: a String representing an item, and a double representi

Make a JavaScript jQuery script to fill variables from a remote JSON file I'm in requirement of someone to write and rewrite some JavaScript code that connects to a remote rest

Describe the Class or static Members ? A method or a field in a Java program could be declared static. That means the member belongs to the class rather than to an individual