[Solution] Yet Another Palindrome Making Problem CodeChef Solution
Chef has a string (containing lowercase Latin letters only) of length where is even. He can perform the following operation any number of times:
- Swap and for any
Determine if Chef can convert string to a palindromic string.
Note: A string is called a palindrome if it reads the same backwards and forwards. For example, and are palindromic strings but is not.
Input Format
- The first line contains a single integer — the number of test cases. Then the test cases follow.
👇👇👇👇👇
- The first line of each test case contains an integer — the length of the string .
- The second line of each test case contains a string of length containing lowercase Latin letters only.
Output Format
For each test case, output YES
if Chef can convert the string to a palindromic string. Otherwise,
output NO
.
You may print each character of YES
and NO
in either uppercase or lowercase (for example, yes
, yEs
, Yes
will be considered identical).
No comments:
Post a Comment