Sponsored Reserved space — layout preview until AdSense is connected
easy +8 pts

Palindrome check

Ignore case and non-alphanumeric.

Implement `is_palindrome(s: str) -> bool`. Ignore case and any character that is not a letter or digit.

Constraints

0 ≤ len(s) ≤ 10^5

Example

>>> is_palindrome("A man, a plan, a canal: Panama")
True
>>> is_palindrome("race a car")
False
8 points ~8 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Filter with isalnum(), lower(), then compare to reversed.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.
Sponsored Reserved space — layout preview until AdSense is connected