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

Handshake packets - computer architecture, Handshake packets: Handshak...

Handshake packets: Handshake packets consist of nothing but a PID byte, and are usually sent in response to data packets. The 3 basic types are, NAK, indicating that the data

Where virtual memory is used, Where Virtual memory is used ? Ans. Virtu...

Where Virtual memory is used ? Ans. Virtual memory is utilized in all main commercial operating systems.

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

Describe the basic aspects of ENIAC, Q. Describe the basic aspects of ENIAC...

Q. Describe the basic aspects of ENIAC? The main aspects of ENIAC can be summarized as: ENIAC was a general purpose-computing machine in that vacuum tube technology was

Functional requirements of a control unit, Q. Functional Requirements of a ...

Q. Functional Requirements of a Control Unit? Let's first try to define functions that a control unit should perform in order to get things to happen. However in order to defin

Describe the necessary conditions for deadlock, Describe the necessary cond...

Describe the necessary conditions for Deadlock. Required conditions for deadlock 1. Mutual exclusion 2. Hold and wait 3. No preemption 4. Circular wait Mutual e

Two ways of producing a list within a transaction, What are the two ways of...

What are the two ways of producing a list within a transaction? By submitting a separate report. By using leave to list-processing.

Differentiate between protected and real modes of an intel, Differentiate b...

Differentiate between protected and real modes of an Intel microprocessor Operation of Real mode interrupt: When microprocessor completes executing the current instruction, it

Editor - tools necessary for assembly language programming, Q. Editor - Too...

Q. Editor - Tools necessary for assembly language programming? The editor is a program which allows the user to enter and modify as well as store a group of instructions or tex

Boolean algebra, https://www.chegg.com/homework-help/questions-and-answers/...

https://www.chegg.com/homework-help/questions-and-answers/57-karnaugh-maps-7-diagram-shows-system-hot-chocolate-drinks-vending-machine-vending-machi-q91661540

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