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