The Water Collector
A hard Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L5
Problem
A survey gives you the `heights` of a row of vertical walls. Any two walls, together with the ground between them, form a container whose capacity is the height of the shorter wall times the distance between the two. Return the greatest capacity any pair of walls can hold.
Summary
Two walls, one sky, and a very important question.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.