#K5686. Palindromic String Checker
Palindromic String Checker
Palindromic String Checker
This problem requires you to determine whether a given string is a palindrome. A palindrome is a string that reads the same backward as forward when ignoring case, spaces, and punctuation.
You are to implement a solution that reads an input string from stdin and outputs True
if the string is a palindrome and False
otherwise. Be sure to ignore all non-alphanumeric characters and treat uppercase and lowercase letters as equal.
Mathematically, if the cleaned string is denoted as \( s \), then the palindrome condition is:
\( s = s^R \)
where \( s^R \) denotes the reverse of \( s \).
inputFormat
Input consists of a single line containing the string to be checked. The string may include spaces, punctuation, and letters in mixed case.
outputFormat
Output a single line: True
if the input string is a palindrome (ignoring spaces, punctuation, and capitalization), or False
otherwise.## sample
A man, a plan, a canal, Panama
True