#C9487. Rearrangement to Palindrome
Rearrangement to Palindrome
Rearrangement to Palindrome
Given a string s consisting of lowercase English letters, determine if it is possible to rearrange the characters of s to form a palindrome.
A palindrome is a string that reads the same backward as forward. Mathematically, a string can be rearranged into a palindrome if at most one character has an odd frequency count, i.e., $$\text{oddCount} \leq 1$$.
For example, the string "ivicc" can be rearranged as "civic", which is a palindrome.
inputFormat
The input consists of a single line containing the string s (1 ≤ |s| ≤ 105), which is composed solely of lowercase English letters.
outputFormat
Output a single line containing YES
if the letters of s can be rearranged to form a palindrome, otherwise output NO
.
civic
YES