Valid Palindrome

Practice this coding question on Coding Gurukul.

Problem statement

A label inspector ignores spaces and punctuation and treats uppercase and lowercase English letters as identical. After retaining only ASCII letters and digits, decide whether the label reads the same forwards and backwards. A label with no retained characters qualifies.

Input format

One line of printable ASCII text; spaces are part of the input.

Output format

Print true or false in lowercase.

Constraints

1 <= input length <= 100000.

Sample input

Step on no pets!

Sample output

true

Sign in to run or submit a solution in C++, Java or Python.