.思路:首位两个指针,将短的一端指针向内移动
class Solution(object):
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
"""
l = 0
r = len(height)-1
res = (r-l)*min(height[l],height[r])
while l<r:
if height[l]>height[r]:
r-=1
else:
l+=1
cur = (r-l)*min(height[l],height[r])
res = max(cur,res)
return res