Trapping Rain Water
hard
1. Given n non-negative integers representing an elevation map where the width of each bar is 1. 2. Compute how much water it can trap after raining.
Constraints
1. n == height.length 2. 0 <= n <= 3 * 10^4 3. 0 <= height[i] <= 10^5
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
12
0
1
0
2
1
0
1
3
2
1
2
1
Sample Output
6