Coding
Calculate how much rainwater can be trapped between elevation bars.
Given 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.
Input: height = [4,2,0,3,2,5]
Output: 9
Explanation: Water is trapped between the boundaries of 4 and 5. The trapped volumes at indices 1 through 4 are 2, 4, 1, and 2 respectively.
Was asked at