Valid Palindrome

Given string *s*, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Return `true` if it reads the same forward and backward.

Input Format

One line string s.

Output Format

Output "true" or "false".

Constraints

  • 0 <= len(s) <= 10^5; contains letters, digits, punctuation.

Examples

Example 1:

Input:

s = "A man, a plan, a canal: Panama"

Output:

true

Explanation:

Ignoring non-alphanumeric and case, it reads "amanaplanacanalpanama" which is a palindrome.

Loading...
Valid Palindrome - Strings DSA Problem