Welcome to the Python screen.
The question is on your right: Trap Rain Water Between Bars. Read through the requirements first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
In a Meta-style coding interview, you are given an array height where each element represents the height of a vertical bar in an elevation map. Return the total amount of rain water that can be trapped after raining.
height, a list of non-negative integersWater above index i is determined by the shorter of the tallest bar to its left and right, minus height[i], if that value is positive.
def trap_rain_water(height):