The question is called the Rainwater harvesting problem. I found a similar question: trapping rain water elevations is array Tried to understand it, but I couldn\'t understa