Container With Most Water · Compound Engineer

Container With Most Water

Choose two vertical lines that hold the most water. Start with the widest pair and always move the shorter line inward, which turns an O(n²) search into one pass.

DSAFreeMediumStep-through playerBy Aayush OstwalSolve on LeetCode ↗
Spotted a mistake in this lesson?Report an issue →