class Solution(object):
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
"""
i, j = 0, len(height) - 1
area = 0
while i < j:
h = min(height[i], height[j])
area = max((j - i) * h, area)
if height[i]< height[j]:
while height[i] <= h and i < j:
i += 1
else:
while height[j] <= h and i < j:
j -= 1
return area