#C10664. Alphanumeric Palindrome Checker
Alphanumeric Palindrome Checker
Alphanumeric Palindrome Checker
Given a string S, determine whether it is a palindrome by considering only alphanumeric characters and ignoring cases. Formally, if we define \( S' \) as the string obtained from \( S \) by removing all non-alphanumeric characters and converting all letters to lowercase, then S is a palindrome if and only if \( S' = \mathrm{reverse}(S') \).
For example, the string "A man, a plan, a canal: Panama" is a palindrome because after filtering and converting to lowercase it becomes "amanaplanacanalpanama", which reads the same backward as forward.
inputFormat
The input consists of a single string S provided via stdin. The string may include spaces, punctuation, and other non-alphanumeric characters.
outputFormat
Output True
if the input string is a palindrome as per the above definition; otherwise, output False
. The result should be printed to stdout.
True