Skip to content

Commit c934be0

Browse files
committed
DaleStudy#242 valid-parentheses calculate complexity
1 parent 6c5814e commit c934be0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

โ€Žcontainer-with-most-water/sungjinwi.py

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
"""
2+
ํ’€์ด :
3+
left, right ์ปค์„œ๋ฅผ ์–‘ ๋์— ๋†“๊ณ  ์กฐ๊ฑด์— ๋”ฐ๋ผ ๋ฐ˜๋Œ€ํŽธ์œผ๋กœ ์ด๋™์‹œํ‚ค๋ฉฐ ๋ฌผ ์–‘ ๋น„๊ต
4+
๋‘˜ ์ค‘ ๋” ๋†’์€ ๋†’์ด๋ฅผ ์ด๋™์‹œํ‚ค๋ฉด ๋ฌด์กฐ๊ฑด ๋ฌผ์˜ ์–‘์ด ์ค„์–ด๋“ค๊ธฐ ๋•Œ๋ฌธ์— ๋” ๋‚ฎ๊ฑฐ๋‚˜ ๊ฐ™์€ ์ปค์„œ๋ฅผ ์ด๋™์‹œํ‚ค๋ฉฐ ์—…๋ฐ์ดํŠธ
5+
๋‘˜์ด ๋งŒ๋‚˜๋ฉด ๋น„๊ต ์ข…๋ฃŒ
6+
7+
8+
len(height) : N
9+
TC : O(N)
10+
l, r์˜ ์ด๋™์ด ์ „์ฒด height ๊ฐœ์ˆ˜๋งŒํผ ์ผ์–ด๋‚˜๋ฏ€๋กœ
11+
SC : O(1)
12+
"""
13+
114
class Solution:
215
def maxArea(self, height: List[int]) -> int:
316
l = 0

0 commit comments

Comments
ย (0)