← DSA practice

Container With Most Water

MediumTwo Pointers

The problem

Given vertical line heights, find two lines that hold the most water with the x-axis.

Full statement, examples and constraints: see the original problem link below.

Solve it on LeetCode