110. Trapping Rain Water
HardTwo pointers
height describes an elevation map where each bar has width 1. Return how much rain water is trapped between the bars.
Example 1
Input: height = [0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1] Output: 6
Constraints
1 ≤ height.length ≤ 2 × 10⁴