...

/

Solution: Container with Most Water

Solution: Container with Most Water

Let's solve the Container with Most Water problem using the Two Pointers pattern.

Statement

You’re given an integer array height of length nn, and there are nn vertical lines drawn such that the two endpoints of the ithi^{th} line are (i,0)(i, 0) and (ii, height[i]).

Find two lines from the input array ...