We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f67102 commit 455955eCopy full SHA for 455955e
container-with-most-water/mandel-17.py
@@ -0,0 +1,13 @@
1
+class Solution:
2
+ def maxArea(self, height: List[int]) -> int:
3
+ max_area = 0
4
+ left, right = 0, len(height) - 1
5
+ while left < right:
6
+ area = (right - left) * min(height[left], height[right])
7
+ max_area = max(area, max_area)
8
+ if height[left] <= height[right]:
9
+ left += 1
10
+ else:
11
+ right -= 1
12
+ return max_area
13
+
0 commit comments