Loading...

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
senior, staff

Problem

Write a function that takes a list of non-negative integers representing wall heights. Find the two walls that together form a container holding the maximum amount of water. Return that maximum water volume.

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.