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
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).
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)