#C13252. Palindrome Permutation Check
Palindrome Permutation Check
Palindrome Permutation Check
Given a string s
consisting of lower case English letters and spaces, determine whether any permutation of s
can form a palindrome. A palindrome is a string that reads the same forwards and backwards. In mathematical terms, if the frequency of characters in the string is represented by \( f_i \), then a palindrome permutation is possible if and only if
\( \sum_{i} [f_i \mod 2] \leq 1 \)
Spaces should be ignored and letter case should be treated uniformly. Your program should read the input from standard input (stdin) and write the result to standard output (stdout) as either True
or False
.
inputFormat
The input consists of a single line containing the string s
. The string may include spaces. All letters are considered in lower case.
outputFormat
Output a single line containing either True
if the input string's characters can be rearranged to form a palindrome, or False
otherwise.
civic
True