#K15146. Palindrome Permutation
Palindrome Permutation
Palindrome Permutation
Given a string s, determine whether the characters of s can be rearranged to form a palindrome. A string is said to be a "palindrome permutation" if its characters can be rearranged to form a palindrome. In other words, at most one character can have an odd frequency among all characters.
Note: Consider the string as case-sensitive. For example, "Aaa" is a palindrome permutation because one character has an odd count and the others even.
The mathematical condition for a palindrome permutation can be stated as:
$$ \text{Let } f(c) \text{ be the frequency of character } c, \text{ then there exists a palindrome permutation if } \sum_{c} [f(c) \mod 2] \le 1.$$
inputFormat
The input consists of a single line containing the string s.
outputFormat
Output True
if the input string can be rearranged to form a palindrome; otherwise, output False
.
civic
True
</p>