#K14596. Can Permute Palindrome

    ID: 24169 Type: Default 1000ms 256MiB

Can Permute Palindrome

Can Permute Palindrome

Given a string (s), determine if any permutation of (s) can form a palindrome. A palindrome is a string that reads the same backward as forward. For a string to have a permutation that forms a palindrome, each character must appear an even number of times, with the possible exception of one character, which may appear an odd number of times. Formally, let (f(c)) be the frequency of character (c) in (s). Then, a necessary and sufficient condition is:

[ \sum_{c \in \text{set}(s)} [f(c) \bmod 2 \neq 0] \leq 1 ]

Your task is to implement a solution that reads the input string from standard input and prints either "True" if a palindromic permutation exists or "False" otherwise.

inputFormat

The input consists of a single line containing the string (s). The string may be empty and can contain any visible ASCII characters.

outputFormat

Output a single line containing either "True" or "False". Output "True" if any permutation of the input string can form a palindrome, otherwise output "False".## sample

civic
True