#K73742. Palindrome Checker: Ignoring Punctuation and Case
Palindrome Checker: Ignoring Punctuation and Case
Palindrome Checker: Ignoring Punctuation and Case
This problem requires you to determine whether a given string is a palindrome. A palindrome is a string that reads the same backwards as forwards. However, the twist is that you should ignore all non-alphanumeric characters and treat uppercase and lowercase letters the same.
Mathematically, if we denote the filtered string (only alphanumeric and in lowercase) as \(S\), the string is a palindrome if and only if \(S = S^R\), where \(S^R\) is the reverse of \(S\).
The input consists of a single line containing the string to check. The output should be either True
or False
depending on whether the string is a palindrome.
inputFormat
The input is provided via standard input and consists of a single line string \(S\). This string can include letters, numbers, spaces, and punctuation.
outputFormat
The output should be printed to standard output. Print True
if the string is a palindrome (ignoring spaces, punctuation, and capitalization), and False
otherwise.
racecar
True
</p>