Loading...
The Water Gauge
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid, senior
Problem
Given a list of non-negative integers representing an elevation map where each value is the height of a bar of width 1, calculate how much water can be trapped between the bars after it rains. Return the total number of water units trapped.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.