Skip to content

Commit daf2819

Browse files
author
Hilal Morrar
committed
Remove unnecessary code from 0011-Container-with-Most-Water
1 parent b8be316 commit daf2819

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Diff for: python/0011-container-with-most-water.py

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ class Solution:
22
def maxArea(self, height: List[int]) -> int:
33
l, r = 0, len(height) - 1
44
res = 0
5-
h = max(height)
65

76
while l < r:
87
res = max(res, min(height[l], height[r]) * (r - l))
@@ -11,6 +10,4 @@ def maxArea(self, height: List[int]) -> int:
1110
elif height[r] <= height[l]:
1211
r -= 1
1312

14-
if (r-l) * h <= res:
15-
break
1613
return res

0 commit comments

Comments
 (0)