Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def maxArea(self, height: List[int]) -> int:
- left = 0
- right = len(height) - 1
- res = 0
- while(left < right):
- area = (right - left)*min(height[left], height[right])
- res = max(area, res)
- if (height[left]<=height[right]):
- left = left + 1
- else:
- right = right - 1
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement