class Solution:
def maxArea(self, height):
if len(height)==2:
return min(height[0], height[1])
lf=0
rg=len(height)-1
max_area=0
for i in range(len(height)-1):
shorter_line = min(height[lf], height[rg])
temp = shorter_line * (rg - lf)
if temp > max_area:
max_area = temp
if shorter_line == height[lf]:
lf += 1
else:
rg -= 1
return max_area