#K40212. Palindrome Checker

    ID: 26593 Type: Default 1000ms 256MiB

Palindrome Checker

Palindrome Checker

Problem Statement:

Given a string s, determine if it is a palindrome. A string is considered a palindrome if it reads the same forward and backward after converting all letters to lowercase and removing all non-alphanumeric characters.

Note: For this problem, ignore spaces, punctuation, and symbols. Only consider letters and digits.

Examples:

  • Input: A man, a plan, a canal: Panama — Output: True
  • Input: race a car — Output: False
  • Input: 12321 — Output: True

The palindrome condition can be formulated as: \( \text{cleaned}(s) = \text{reverse}(\text{cleaned}(s)) \), where the cleaned string contains only lowercase alphanumeric characters.

inputFormat

The input is provided via stdin as a single line containing the string s to check.

outputFormat

Output a single line to stdout, which is either True if s is a palindrome or False otherwise.

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