#K91322. Taco Palindrome Checker
Taco Palindrome Checker
Taco Palindrome Checker
Given a string s
, remove all characters that are not letters or digits and convert all uppercase letters to lowercase. Then determine if the resulting string is a palindrome.
A palindrome is defined as a string that reads the same forwards and backwards. Mathematically, this condition can be written using LaTeX as:
$$ \forall i \; (1 \leq i \leq n), \; S[i] = S[n-i+1] $$
Here, S
is the processed string of length n
.
inputFormat
The input consists of a single line containing a string s
. The string may include spaces, punctuation, and digits.
You should read the input from stdin.
outputFormat
Output a single line containing either True
if the processed string is a palindrome or False
otherwise. Write your output to stdout.
A man, a plan, a canal: Panama
True
</p>