#C5426. Palindrome Permutation Checker
Palindrome Permutation Checker
Palindrome Permutation Checker
You are given a string s
consisting of alphabetical characters. Your task is to determine if any permutation of the string can form a palindrome.
A palindrome is a string that reads the same backward as forward. In order for a permutation of the string to form a palindrome, at most one character may appear an odd number of times.
For example, the string "civic"
is already a palindrome, while "ivicc"
can be rearranged to form "civic"
. On the other hand, "hello"
cannot be rearranged to form a palindrome.
Determine whether such a permutation exists for the given string.
inputFormat
The input consists of a single line containing the string s
.
Constraints:
- 1 ≤ |s| ≤ 105
s
contains only alphabetical characters.
outputFormat
Output True
if any permutation of the string s
can form a palindrome, otherwise output False
.
civic
True