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 fcfd652 commit f640440Copy full SHA for f640440
container-with-most-water/sejineer.py
@@ -0,0 +1,17 @@
1
+"""
2
+시간 복잡도: O(N)
3
+공간 복잡도: O(1)
4
5
+class Solution:
6
+ def maxArea(self, height: List[int]) -> int:
7
+ result = 0
8
+ start, end = 0, len(height) - 1
9
+
10
+ while start < end:
11
+ area = (end - start) * min(height[start], height[end])
12
+ result = max(result, area)
13
+ if height[start] < height[end]:
14
+ start += 1
15
+ else:
16
+ end -= 1
17
+ return result
0 commit comments