#K66732. Palindrome Checker
Palindrome Checker
Palindrome Checker
You are given a string s. Your task is to determine whether s is a palindrome when considering only alphanumeric characters and ignoring cases, spaces, and punctuation.
In other words, first remove all characters from s that are not letters or digits, and then transform all letters to lowercase. If the transformed string reads the same forwards and backwards, then it is considered a palindrome.
The process can be summarized by the formula:
$$ \text{isPalindrome}(s) = \left( f(s) == reverse(f(s)) \right) $$
where $$ f(s) $$ is the function that removes non-alphanumeric characters and converts everything to lowercase.
Input will be provided via standard input (stdin) and the answer should be output to standard output (stdout).
inputFormat
The input consists of a single line containing a non-empty string s, which may include spaces, punctuation, and mixed case letters.
outputFormat
Output a single line containing either True
if the string is a palindrome according to the given rules, or False
otherwise.
A man, a plan, a canal: Panama
True