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 0e87ace commit f2daef6Copy full SHA for f2daef6
container-with-most-water/printjin-gmailcom.py
@@ -0,0 +1,13 @@
1
+class Solution:
2
+ def maxArea(self, height):
3
+ left, right = 0, len(height) - 1
4
+ max_area = 0
5
+ while left < right:
6
+ h = min(height[left], height[right])
7
+ w = right - left
8
+ max_area = max(max_area, h * w)
9
+ if height[left] < height[right]:
10
+ left += 1
11
+ else:
12
+ right -= 1
13
+ return max_area
0 commit comments