Container with Most Water
Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.
The problem
- medium
- Pro
You're given a row of vertical lines of different heights, evenly spaced. Pick two lines that, together with the ground, hold the most water. The water level is limited by the shorter line, and the width is the distance between them. Explain how to find the best pair faster than trying every pair.
Talk this problem through with an AI coach
This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.