#C7421. Valid Palindrome Checker
Valid Palindrome Checker
Valid Palindrome Checker
Given a string, your task is to determine whether it is a valid palindrome. An input string is considered a palindrome if, after converting all uppercase letters to lowercase and removing all non-alphanumeric characters, it reads the same forward and backward.
Note: An empty string is considered a valid palindrome.
The transformation can be expressed in LaTeX as follows:
\( s' = \text{lowercase}(\{ c \in s : c \text{ is alphanumeric} \}) \)
The string \( s \) is a palindrome if and only if \( s' = (s')^R \), where \( (s')^R \) is the reverse of \( s' \).
inputFormat
The input consists of a single string provided via standard input. The string may contain spaces, punctuation, and other characters.
outputFormat
Output a single line containing either True
or False
(without quotes), indicating whether the given string is a valid palindrome.
A man, a plan, a canal: Panama
True