Search & scan line
Two Pointers problems
Two positions move over the same list, often from both ends toward the middle. Each step rules out part of the list, so one pass replaces checking every pair.
- 1 easy
- 3 medium
- 1 hard
The 5 problems
In the order the app teaches them. Each page has the problem, five hints and the explained solution.
- Valid PalindromeEasy
- Two Sum II Input Array Is SortedMedium
- 3SumMedium
- Container With Most WaterMedium
- Trapping Rain WaterHard
On the roadmap
Two Pointers is a station on the search & scan line. It builds on Arrays & Hashing. Next comes Sliding Window.
The roadmap says why each line runs in its order.
Patterns
One pattern solves these problems. Naming them gives the problems’ methods away, so the list is folded.
Show it
- Opposing two pointers5 problems