Valid Palindrome: the skills you need first
Updated
LeetCode · easy · two pointers. Skip junk, lowercase, then close the gap. Mismatch is the answer.
Skills this problem builds on
Stuck on Valid Palindrome? It is usually one of these. Get each one solid and the solution stops being a trick.
- Place opposite-end pointers
Opposite-end placement puts L at index 0 and R at index n-1 so the two indices face each other across the whole array. You name them from length. You do not scan to find the ends.
- Skip non-alphanumeric characters
- Convert a character to lowercase
check which ones you have 10 minutes, free, no account.
More two pointers problems
- Two Sum IImedium
- 3Summedium
- Container With Most Watermedium