Problem
Givenn non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
Examples
Constraints
n == height.length1 <= n <= 2 * 10^40 <= height[i] <= 10^5
Tested Python solution for LeetCode 42 with 15 pytest cases. Generate a practice environment with lcpy.
n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
n == height.length1 <= n <= 2 * 10^40 <= height[i] <= 10^5