Build the PrimitiveMedium
Container With Most Water
Write `max_area(heights)` where `heights[i]` is the height of a vertical line at position `i`. Return the largest area of water any two lines can hold: `min(h[i], h[j]) * (j - i)`.
max_area([1, 8, 6, 2, 5, 4, 8, 3, 7]) -> 49
Start wide and move inward, always advancing the shorter side. The proof is the answer they want: moving the taller side can only ever reduce the width while the height stays capped by the shorter one, so nothing better can be lost by discarding it.
What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.