#11

Container With Most Water

medium· Two Pointersruns: 0

You are given an integer array heights of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, heights[i]). Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of water the container can store.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.