class Solution:
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
"""
ans = 0
l = 0
r = len(height) - 1
while l < r:
w = min(height[l], height[r])
ans = max(ans, w * (r - l))
if height[l] < height[r]:
l += 1
else:
r -= 1
return ans
网友评论