#K12906. Palindrome Permutation Checker
Palindrome Permutation Checker
Palindrome Permutation Checker
You are given a string s that may contain letters, spaces, punctuation, and mixed case characters. Your task is to determine if any permutation of the alphabetic characters in s can form a palindrome. When checking for palindromes, ignore non-alphabet characters and treat uppercase and lowercase letters as equal.
A string can be permuted to form a palindrome if at most one character occurs an odd number of times. For example, the string "Tact Coa" can be rearranged to form "taco cat", which is a palindrome.
Note: An empty string is considered a valid palindrome.
inputFormat
The input consists of a single line containing the string s.
You should read the input from standard input (stdin).
outputFormat
Output a single line to standard output (stdout) with either True
or False
. Output True
if any permutation of the string can form a palindrome; otherwise, output False
.
Tact Coa
True