#K92282. Palindrome Rearrangement
Palindrome Rearrangement
Palindrome Rearrangement
Given a string s, determine whether its letters can be rearranged to form a palindrome.
A palindrome is a word that reads the same backward as forward. It is well known that a string can be rearranged to form a palindrome if and only if the number of characters with an odd frequency does not exceed one. In mathematical terms, let \( f(c) \) denote the frequency of character \( c \) in the string, then the necessary and sufficient condition is:
\( \sum_{c} (f(c) \bmod 2) \le 1 \)
Help determine if each given string can satisfy this condition.
inputFormat
The input consists of multiple test cases. The first line contains an integer T representing the number of test cases. Each of the following T lines contains a non-empty string s.
outputFormat
For each test case, output a single line containing "YES" if the characters of the string can be rearranged to form a palindrome, otherwise output "NO".
## sample3
civic
ivicc
hello
YES
YES
NO
</p>