We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bcabcb commit ad1357bCopy full SHA for ad1357b
1 file changed
0011-container-with-most-water/0011-container-with-most-water.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def maxArea(self, height: List[int]) -> int:
3
+ start, end = 0, len(height) - 1
4
+ total = []
5
+ while start < end:
6
+ total.append(min(height[start], height[end]) * (end - start))
7
+ if height[start] < height[end]: start += 1
8
+ else: end -= 1
9
+ return max(total)
0 commit comments