Skip to content

Commit 008b80e

Browse files
authored
Update Container With Most Water - Leetcode 11.py
1 parent c2182f5 commit 008b80e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Container With Most Water - Leetcode 11.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ def maxArea(self, height: List[int]) -> int:
1010
h = min(height[l], height[r])
1111
a = w * h
1212
max_area = max(max_area, a)
13+
1314
if height[l] < height[r]:
1415
l += 1
1516
else:
1617
r -= 1
1718

1819
return max_area
20+
21+
# Time Complexity: O(n)
22+
# Space Complexity: O(1)

0 commit comments

Comments
 (0)