#C12746. Palindrome Checker

    ID: 42207 Type: Default 1000ms 256MiB

Palindrome Checker

Palindrome Checker

Given a string, check if it is a palindrome. A palindrome reads the same forward and backward after removing any non-alphanumeric characters and converting all letters to lowercase. In other words, if we define a filtered string \( s' \) by removing all characters that are not digits or letters and converting all letters to lowercase, then the string is a palindrome if \( s' = (s')^R \), where \((s')^R\) is the reversal of \( s' \).

The solution should read input from stdin and write the result to stdout as either True or False.

inputFormat

The input consists of a single line containing the string that needs to be checked. The string may include spaces, punctuation, numbers, and letters.

outputFormat

Output True if the string is a palindrome after filtering, or False otherwise.## sample

A man, a plan, a canal, Panama!
True