#K73287. Valid Palindrome
Valid Palindrome
Valid Palindrome
Given a string S, determine whether it is a palindrome. For this problem, when checking for palindromicity, consider only alphanumeric characters and ignore cases. In other words, after converting all letters to lowercase and removing non-alphanumeric characters, the string should read the same forward and backward. Formally, let \( S' \) be the normalized string and the condition for a palindrome is:
[ S' = \text{reverse}(S') ]
If the condition holds, output True
; otherwise, output False
.
inputFormat
The input consists of a single line containing the string \( S \). The string may include spaces, punctuation, and other non-alphanumeric characters.
outputFormat
Output a single line with True
if the normalized string is a palindrome, and False
otherwise.
A man, a plan, a canal: Panama
True