Polycarp can just settle one errand during the day. Consistently he recorded what task he tackled. Presently the educator needs to know whether Polycarp followed his recommendation.    For instance, assuming Polycarp tackled errands in the accompanying request: "DDBBCCCBBEZ", the educator will see that on the third day Polycarp started

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will be upvoted else downvoted. 

 

Polycarp can just settle one errand during the day. Consistently he recorded what task he tackled. Presently the educator needs to know whether Polycarp followed his recommendation. 

 

For instance, assuming Polycarp tackled errands in the accompanying request: "DDBBCCCBBEZ", the educator will see that on the third day Polycarp started to settle the assignment 'B', then, at that point, on the fifth day he got occupied and started to address the undertaking 'C', on the eighth day Polycarp got back to the assignment 'B'. Different instances of when the educator is dubious: "BAB", "AABBCCDDEEBZZ" and "AAAAZAAAAA". 

 

Assuming Polycarp addressed the errands as follows: "FFGZZZY", the educator can't have any doubts. Kindly note that Polycarp isn't committed to settle all errands. Different instances of when the instructor doesn't have any dubious: "BA", "AFFFCC" and "YYYYY". 

 

Assist Polycarp with seeing whether his educator may be dubious. 

 

Input 

 

The main line contains an integer t (1≤t≤1000). Then, at that point, t experiments follow. 

 

The principal line of each experiment contains one integer n (1≤n≤50) — the number of days during which Polycarp addressed assignments. 

 

The subsequent line contains a line of length n, comprising of capitalized Latin letters, which is the request wherein Polycarp tackled the assignments. 

 

Output 

 

For each experiment output: 

 

"Indeed", if the instructor can't be dubious; 

 

"NO", in any case. 

 

You might print each letter regardless you need (along these lines, for instance, the strings yEs, indeed, Yes and YES are totally perceived as sure reply).

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
System Model Approaches
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education