Here is the interview question prompt, presented for reference.
Imagine you're looking at an elevation map displaying rainfall over a region's landscape. The map consists of bars of varying heights, each representing different elevations. Can you determine the amount of rainwater that this uneven terrain can hold?
![Elevation Map](https://storage.googleapis.com/algodailyrandomassets/curriculum/stacks/rain0.png)
We'll simplify the problem by using a one-dimensional array of non-negative integers. Each integer represents the height of the land at different points. The objective is to calculate the volume of rainwater that can be trapped by this series of elevations.
To better visualize this, consider the diagram below, which illustrates various elevation maps and the potential rainwater they can hold. Think of it like a game of Tetris; we aim to find how many units of rainwater could be accommodated in the available gaps.
![Rainwater in Elevation Maps](https://storage.googleapis.com/algodailyrandomassets/curriculum/stacks/rain1.png)
100000
0
2^32
)O(n)
O(1)
You can see the full challenge with visuals at this link.
Challenges • Asked almost 7 years ago by Jake from AlgoDaily
This is the main discussion thread generated for Trapping Rain Water.
There are no test cases and the environment does not support python
Thanks for the heads up and sorry for the miss! Added to the queue for the team to address, will update when resolved.
Thank you
Updated and resolved :-)