Skip to content

Commit ad1357b

Browse files
committed
Time: 74 ms (85.22%), Space: 28.7 MB (24.18%) - LeetHub
1 parent 5bcabcb commit ad1357b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)