42. Trapping Rain Water
Two Pointers — O(n) time, O(1) space
Apply
Example 1
Example 2
V-Shape
Complex
Staircase
W-Shape
Step
Play
Pause
Reset
Speed:
5x
Bar
Water
Left Pointer
Right Pointer
leftMax
rightMax
Water:
0
Left:
0
Right:
-
leftMax:
0
rightMax:
0
Total Water Trapped:
0
units
Ready. Press Step or Play to begin.