Foundations
Two Pointers
Walk two indices through an array instead of nesting loops: pointers from both ends for sorted pairs and palindromes, read/write pointers for in-place edits, and sort-then-squeeze for k-sum.
0 of 3 lessons complete, 0 of 7 problems solved
Coursework
37 min
Up next
The Two-Pointer Idea
Squeeze a sorted array from both ends and learn why each move is safe.
12 min
Read & Write Pointers
Filter, dedupe and partition an array in place with two pointers moving the same way.
12 min
Sort First, Skip Duplicates, Fast & Slow
Sort to unlock two pointers for k-sum, avoid duplicate answers, and meet fast/slow pointers.
13 min
Practice ladder
Start with the first problem, then work toward the harder variations. Run examples before submitting against all tests.
Next unit: Sliding Window