ABC
Recently, the students of School 179 have developed a unique algorithm, which takes in a binary string
A binary string is a string where each character is either 0 or 1.
A string
A palindrome is a string that reads the same backwards as forwards.
Each test contains multiple test cases. The first line contains the number of test cases
The first line of each test case contains a single integer
The second line of each test case contains the string
For each test case, print YES (case-insensitive) if it is possible to reorder the characters of
In the first three test cases, the given strings do not contain palindromes of length greater than 1, so the answers are YES.
In the last test case, it is impossible to reorder the characters so that the string does not contain palindromes of length greater than 1, so the answer is NO.
Solution link below:
if 1st link is not work then click on another link
solution link 1
Solution link 2
Solution link 3
No comments:
Post a Comment