Trapping Rain Water — Two Pointers

Total the rainwater a line of uneven dam walls retains after a storm, with water escaping over both outer ends.

Two Pointers · Hard

More in Two Pointers

All algorithm problems