class Solution:
def maxArea(self, height: list[int]) -> int:
result = 0
l, r = 0, len(height) - 1
while l != r:
result = max(result, min(height[l], height[r]) * (r - l))
if height[l] < height[r]:
l += 1
else:
r -= 1
return result
11. Container With Most Water - LeetCode
ยท One min read