#C4620. Palindrome Permutation Check
Palindrome Permutation Check
Palindrome Permutation Check
Given a string s containing only lowercase English letters, determine whether any permutation of s can form a palindrome.
A palindrome is a string that reads the same forwards and backwards. A necessary and sufficient condition for a string to be rearranged into a palindrome is that at most one character appears an odd number of times. Mathematically, if \( \text{odd_count} \) denotes the number of characters with an odd frequency, then the string can form a palindrome if and only if
$$\text{odd_count} \le 1$$
For example, "civic" can be rearranged into a palindrome, whereas "hello" cannot.
inputFormat
The input consists of a single line containing the string s
.
outputFormat
Output True
if some permutation of the string can form a palindrome. Otherwise, output False
. The output should be written to standard output.
civic
True