solulubeta
Sign in
NeetCode 150 / Two Pointers
02.04 · Problem

Container With Most Water

Medium Two pointers, move the shorter side 1 video LC 11 Pro

This problem is part of solulu Pro

You're given n vertical lines; line i stands at x = i with height height[i]. Pick two lines that, together with the x-axis, form a container. The water it holds is min(height[i], height[j]) × (j − i). Return the maximum…

Lifetime ₹1,999 ₹999 · Launch offer
Mark this problem as solved when you are finished.

Item 13 of 150 · updated 2026-10-12