#C1074. Mirrored String Formation

    ID: 39978 Type: Default 1000ms 256MiB

Mirrored String Formation

Mirrored String Formation

You are given a string and your task is to determine whether its characters can be rearranged to form a mirrored string. A string is said to be rearrangeable into a mirrored string if it satisfies the following condition:

$$\text{At most one character can have an odd frequency count.} $$

For example, if the string is civic, it can be rearranged into civic which is a mirrored string. However, if the string is hello, it cannot be rearranged to form such a string.

Your program should process multiple test cases from standard input and output the answer for each on a new line.

inputFormat

The first line contains an integer TT, denoting the number of test cases. Each of the next TT lines contains a single string ss consisting of lowercase letters.

outputFormat

For each test case, output a single line containing either YES if the string can be rearranged to form a mirrored string, or NO otherwise.## sample

3
civic
ivicc
hello
YES

YES NO

</p>