#C149. Palindrome Checker

    ID: 44599 Type: Default 1000ms 256MiB

Palindrome Checker

Palindrome Checker

In this problem, you are given a string. Your task is to determine whether the string is a palindrome when considering only alphanumeric characters and ignoring case. In other words, you must remove all characters that are not letters or digits, convert the remaining letters to lowercase, and then check if the resulting string reads the same forwards and backwards.

For example:

  • A man, a plan, a canal, Panama! should output True.
  • Hello, World! should output False.

This problem tests your ability to perform string manipulation and basic algorithmic checks.

inputFormat

The input consists of a single line containing a string s. The string may include spaces, punctuation, and a mix of uppercase and lowercase letters.

outputFormat

Print a single line with either True or False. Output True if the cleaned string (only alphanumeric characters in lowercase) is a palindrome, and False otherwise.

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