Skip to content

#42 - Trapping Rain Water

HardArray / String
Open on LeetCode

Given n non-negative integers representing an elevation map where each bar has width 1, compute how much water it can trap after raining.

InputOutput
height = [0,1,0,2,1,0,1,3,2,1,2,1]6
height = [4,2,0,3,2,5]9

Released under the MIT License.