#K12771. Palindrome Checker
Palindrome Checker
Palindrome Checker
You are given a string that may contain letters, digits, spaces, punctuation, and other characters. Your task is to determine whether the string is a palindrome when considering only alphanumeric characters, and ignoring differences in case. In other words, a string is considered a palindrome if it reads the same forwards and backwards after removing all non-alphanumeric characters and converting all letters to lowercase.
For example, the phrase "A man, a plan, a canal, Panama" is a palindrome when ignoring spaces, punctuation, and letter casing.
Note that an empty string or a string with only punctuation is considered a palindrome.
inputFormat
The input consists of a single line containing the string to be checked. The string can include spaces, punctuation, digits, and letters.
outputFormat
Output a single line containing either True
if the string is a palindrome or False
otherwise.
The output should be written to standard output.
## sampleA man, a plan, a canal, Panama
True