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++

A luminous jewel game, a luminous jewel game c programming start with t and...

a luminous jewel game c programming start with t and end with t the output will yes or no

forensics capability relevant to a honeynet server, A local government org...

A local government organisation needs to deploy a honey net. To this end you are to deploy a honeynet based on the supplied network diagram (separate download) that should give sop

Describe about javascript, World Wide Web (WWW) began as a text-only medium...

World Wide Web (WWW) began as a text-only medium. First version doesn't even have the capability to include graphics on a page. Today's Web sites include sound animation, graphics,

difference among primary and secondary storage device, In primary storage ...

In primary storage device the storage capacity is fixed. It has a volatile memory. In secondary storage device the storage capacity is not limited. It is a nonvolatile memory. Prim

Computer graphics, raster scan and random display technology

raster scan and random display technology

Uniform memory access model (uma), Uniform Memory Access Model (UMA) In...

Uniform Memory Access Model (UMA) In this model, the main memory is uniformly shared by all processors in multiprocessor systems and each processor has equal access time to sha

Explain the graphic display system, Q. Explain the graphic display system? ...

Q. Explain the graphic display system? The function of your graphic display system is to display bit-mapped graphics on your monitor.  The image displayed on your system so com

What are the advantages of using xml over html, What are the advantages of ...

What are the advantages of using XML over HTML? The root cause of the problem lies within HTML that is Hyper Text Markup Language, the defector standard for web publication. Th

What are the process states in unix, What are the process states in Unix? ...

What are the process states in Unix? As a process implements it changes state according to its circumstances. Unix processes have the following states: Running : The process

What is program controlled i/o, What is program controlled I/O? In prog...

What is program controlled I/O? In program controlled I/O the processor repeatedly checks a status flag to achieve the needed synchronization among the processor and an input a

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