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

Translate the sentences into predicate calculus, Translate each of the foll...

Translate each of the following sentences into predicate calculus, conceptual dependencies, and conceptual graphs: 1. Bill sold the book to the book store." 2. "John borrowed

Demonstration of a micro controller system, Within the Microelectronics cen...

Within the Microelectronics centre we support the following microcontrollers 68HC11, 80C51 and the PIC16C5xx series; we have a set of software tools and emulators to help debug hig

#logic function, Minimize the following logic function using K-maps and rea...

Minimize the following logic function using K-maps and realize using NAND and NOR gates. F(A,B,C,D) =?_m(1,3,5,8,9,11,15) + d(2,13).

Illustrate the logical view of a system, Illustrate the Logical view of a s...

Illustrate the Logical view of a system The Logical view of a system serves to describe existence and meaning of key abstractions and mechanism which form problem space, or wh

Explain their characteristics and limitations of grammar, Identify the diff...

Identify the different classes of grammar. Explain their characteristics and limitations. As proposed through Noam Chomsky that Chomsky hierarchy contains the subsequent level

Explain applications of parallel processing, APPLICATIONS OF PARALLEL PROCE...

APPLICATIONS OF PARALLEL PROCESSING Parallel computing is an development of sequential computing which tries to emulate what has always been the condition of affairs in natural

Eight-stage process - conjunctive normal forms, Eight-stage process - Conju...

Eight-stage process - Conjunctive normal forms: Hence we notice the following eight-stage process converts any sentence with CNF as:  1.  Eliminate all arrow connectives by

Explain the disadvantages of random scan display, Disadvantages of random s...

Disadvantages of random scan display - Just by wire-frame, it is almost impossible to create images with shaded objects or areas filled with a given colour. - In case

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