#C12989. Palindrome Checker
Palindrome Checker
Palindrome Checker
The task is to determine whether a given string is a palindrome. A string is considered a palindrome if it reads the same backward as forward after ignoring spaces, punctuation, and differences in capitalization.
You need to remove all non-alphanumeric characters from the string and convert all letters to lowercase. Then, check if the resulting string is the same when reversed. Formally, if \(s\) is the input string, let \(clean(s)\) be the string obtained by removing all characters which are not in \( [a-zA-Z0-9] \) and converting it to lowercase. The string is a palindrome if and only if:
\[ clean(s) = \text{reverse}(clean(s)) \]An empty string is considered a palindrome.
inputFormat
The input consists of a single line containing the string to be checked. The string may include spaces, punctuation, and digits.
outputFormat
Output a single line: 'True' if the string is a palindrome (ignoring non-alphanumeric characters and case), or 'False' otherwise.## sample
A man a plan a canal Panama
True