← ALL NOTES
Two Pointers

125. Valid Palindrome

No need to build a cleaned copy of the string — two pointers from the ends, each skipping non-alphanumeric characters in place, comparing the lowercased letters as they close in. First mismatch → not…

Loading…