#K51552. 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 palindrome is a sequence that reads the same backward as forward.
Only alphanumeric characters are considered and letter case is ignored. That is, characters such as 'A' and 'a' are treated the same. In order for a string to be rearranged into a palindrome, at most one character can have an odd frequency.
Constraints: The input string contains at most 1000 characters.
Example:
Input: aabbcc
Output: YES
inputFormat
The input consists of a single line containing the string s
.
outputFormat
Print "YES" if the characters of s
can be rearranged to form a palindrome, otherwise print "NO".## sample
aabbcc
YES