TEAMUnregistered
Problemset/

Valid Palindrome

Easy

Valid Palindrome

EasyPoints: 100Time Limit: 2s

A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward.

Given a string s, return true if it is a palindrome, or false otherwise.

Input Format

  • A single line containing the string s.

Output Format

  • Print true or false.

Sample Test Cases

Case 1
Input:
A man, a plan, a canal: Panama
Expected Output:
true
Case 2
Input:
race a car
Expected Output:
false
solution.py
python · UTF-8
Ln 1, Col 1·1 lines
Spaces: 4• Ready