#K7386. Can Form Palindrome
Can Form Palindrome
Can Form Palindrome
Given a string s
consisting of both uppercase and lowercase letters, determine if its characters can be rearranged to form a palindrome. A palindrome is a word that reads the same backward as forward.
Formally, a string can be rearranged into a palindrome if at most one character appears an odd number of times. In mathematical terms, let \( oddCount \) be the number of characters with an odd frequency. Then, the condition is:
[ oddCount \leq 1 ]
Note that the comparison is case-insensitive, meaning that 'A' and 'a' are considered the same character.
inputFormat
The input consists of a single line containing the string s
.
Constraints:
s
contains only alphabetic characters.- Both uppercase and lowercase letters may appear in
s
.
outputFormat
Output a single line with either True
if the string can be rearranged to form a palindrome, or False
otherwise.
civic
True