#K51877. Valid Palindrome

    ID: 29185 Type: Default 1000ms 256MiB

Valid Palindrome

Valid Palindrome

Given a string ( s ), determine whether it is a palindrome considering only alphanumeric characters and ignoring case differences. A palindrome is a string that reads the same backward as forward. For example, the string "A man, a plan, a canal: Panama" is a valid palindrome.

In this problem, you should remove all non-alphanumeric characters and compare the remaining characters without considering case.

Formally, if we define ( f(s) ) as the processed string containing only alphanumeric characters in lower-case, then the string is a palindrome if and only if ( f(s) = \text{reverse}(f(s)) ).

inputFormat

The input consists of a single line of text which represents the string ( s ) to be checked. The string may contain spaces, punctuation, and other non-alphanumeric characters.

outputFormat

Output a single line containing either "True" if the string is a palindrome after processing, or "False" otherwise.## sample

A man, a plan, a canal: Panama
True