#K43077. Rearrange to Palindrome
Rearrange to Palindrome
Rearrange to Palindrome
Given a string S, determine whether its characters can be rearranged to form a palindrome. A string can be rearranged to a palindrome if and only if at most one character appears an odd number of times. Mathematically, if we let \( n_{odd} \) denote the number of characters with odd frequency counts, then the necessary and sufficient condition is \( n_{odd} \leq 1 \).
Your task is to process multiple test cases. For each test case, you are given an integer N (which is the length of the string) and the string S. Check whether the string S can be rearranged to form a palindrome.
inputFormat
The input begins with a single integer T representing the number of test cases. Each of the following T lines contains an integer N followed by a non-empty string S separated by a space. Here, N is the length of S.
outputFormat
For each test case, output a single line: "yes" if the string can be rearranged to form a palindrome, or "no" otherwise.
## sample3
3 abc
4 aabb
6 racecar
no
yes
yes
</p>