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 c1637f6 commit 3771ae2Copy full SHA for 3771ae2
1 file changed
container-with-most-water/gyeo-ri.py
@@ -1,3 +1,12 @@
1
+"""
2
+[결과 요약]
3
+# 시도한 로직 수: 3
4
+ 1. 모든 결과룰 순회하면서 시간복잡도 O(n^2)을 시도 -> LeetCode에서 Time Limit Exceed 발생
5
+ 2. 리스트 양쪽 끝에서 포인터를 이동하는 알고리즘: 시간/공간 모두 O(n)
6
+ 3. (2)의 로직은 유지한 채로 코드 가독성을 개선(알고리즘의 흐름을 쉽게 이해할 수 있도록)
7
8
+
9
10
class Solution:
11
def maxArea(self, height: list[int]) -> int:
12
left, right = 0, len(height) - 1
0 commit comments