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
- L4
Problem
Given a list of non-negative integer heights, return the total units of water trapped above the bars after rain using the two-pointer algorithm.
Summary
Elevation bars trap water between peaks - count the volume.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.