Container With Most Water
intermediateFinds two lines forming the largest water container using two pointers that always move the shorter line inward.
We place two pointers — L at the leftmost bar (height 1) and R at the rightmost bar (height 7). Each step we calculate how much water fits between them, then move the shorter bar inward to try to find a bigger container.
1 / 25