class Solution(object):
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
"""
a = 0
b = len(height) - 1
mymax = min(height[a], height[b]) * (b - a)
while a < b:
if min(height[a], height[b]) * (b - a) > mymax:
mymax = min(height[a], height[b]) * (b - a)
if height[a] < height[b]:
a += 1
else:
b -= 1
return mymax
从两边搜索