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 5008b80 commit 323fa15Copy full SHA for 323fa15
container-with-most-water/doh6077.py
@@ -0,0 +1,16 @@
1
+# 11. Container With Most Water
2
+
3
+# Use two pointesr
4
+class Solution:
5
+ def maxArea(self, height: List[int]) -> int:
6
+ left, right = 0, len(height) -1
7
+ container = 0
8
9
+ while left < right:
10
+ cal = ((right - left) * min(height[left], height[right]))
11
+ container = max(container, cal)
12
+ if height[left] > height[right]:
13
+ right -= 1
14
+ else:
15
+ left += 1
16
+ return container
0 commit comments