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 61d582f commit d807266Copy full SHA for d807266
container-with-most-water/HodaeSsi.py
@@ -0,0 +1,17 @@
1
+# 시간 복잡도 : O(n)
2
+# 공간 복잡도 : O(1)
3
+# 문제 유형 : Two Pointer
4
+class Solution:
5
+ def maxArea(self, height: List[int]) -> int:
6
+ left, right = 0, len(height) - 1
7
+ max_area = 0
8
+
9
+ while left < right:
10
+ max_area = max(max_area, (right - left) * min(height[left], height[right]))
11
+ if height[left] < height[right]:
12
+ left += 1
13
+ else:
14
+ right -= 1
15
16
+ return max_area
17
0 commit comments