#K91007. Palindrome Checker
Palindrome Checker
Palindrome Checker
In this problem, you are given a string S. Your task is to determine whether the string is a palindrome after converting all uppercase letters to lowercase and removing all non-alphanumeric characters. A string is a palindrome if it reads the same forward and backward.
Formally, let \(S\) be the input string and let \(C(S)\) denote the string formed by removing all non-alphanumeric characters from \(S\) and converting the remaining characters to lowercase. You need to check whether
\[ C(S) = \text{reverse}(C(S)) \]
If the condition holds, print True
; otherwise, print False
.
Example: For the input "A man, a plan, a canal: Panama", after processing the string becomes "amanaplanacanalpanama", which is a palindrome.
inputFormat
The input consists of a single line containing the string S. The string may include spaces, punctuation, and a mix of uppercase and lowercase letters.
outputFormat
Output a single line with True
if the processed string is a palindrome, or False
otherwise.
A man, a plan, a canal: Panama
True