Valid Palindrome
Easy
LC #125
stringopposite endsNot attempted yet
Given a string s, return True if it's a palindrome
once you ignore everything that isn't a letter or digit and
treat upper and lower case as equal. Otherwise return
False.
Example 1
Input: s = "A man, a plan, a canal: Panama"
Output: True
Letters only: "amanaplanacanalpanama"
Example 2
Input: s = "race a car"
Output: False
"raceacar" reversed is "racaecar".
Example 3
Input: s = " "
Output: True
Nothing left after filtering: an empty
string is a palindrome.
Constraints
- 1 ≤ len(s) ≤ 2 × 10⁵
shas printable ASCII characters only- Aim for O(1) extra space