125. Valid Palindrome

Practice Valid Palindrome for free on NudgeCode: Easy, Two Pointers pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

Ignore every character that is not a letter or digit, and treat uppercase and lowercase letters as the same. Return true if what remains reads the same forwards and backwards. An empty result counts as a palindrome.

Example

s = "A man, a plan, a canal: Panama"  ->  true    ("amanaplanacanalpanama")
s = "race a car"                      ->  false

Constraints