Skip to content

Trapping Rain Water

A Hard coding interview problem in the Two Pointers pattern.

Pattern

Two Pointers

Walk inward or in lockstep over a sorted or symmetric sequence.

Recognition cue: The input is sorted (or can be), or you compare elements from both ends.

Learn first

Topics

  • Array
  • Two Pointers
  • Dynamic Programming
  • Stack
  • Monotonic Stack
  1. 1Hard
  2. 2Medium
  3. 3Medium
  4. 4Medium
  5. 5Medium
  6. 6Medium
  7. 7Medium
  8. 8Medium