#C12116. Palindrome Checker
Palindrome Checker
Palindrome Checker
Given a string S, determine whether it is a palindrome. In other words, check if S reads the same forward and backward when ignoring case and non-alphanumeric characters.
Formally, let \( S' \) be the string formed by removing all characters from S that are not alphanumeric and converting all letters to lowercase. You are to decide whether \( S' = \text{reverse}(S') \). For example, if \( S = \texttt{A man, a plan, a canal: Panama} \), then \( S' = \texttt{amanaplanacanalpanama} \), and since \( S' \) equals its reverse, the answer is True
.
inputFormat
The input consists of a single line containing a string S. The string may include spaces, punctuation, and mixed case letters.
outputFormat
Output True
if the processed string is a palindrome, and False
otherwise. The output should be printed on a single line.
A man, a plan, a canal: Panama
True