Skip to content

Commit

Permalink
DaleStudy#242 valid-parentheses calculate complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
sungjinwi committed Jan 18, 2025
1 parent 6c5814e commit c934be0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions container-with-most-water/sungjinwi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
"""
ํ’€์ด :
left, right ์ปค์„œ๋ฅผ ์–‘ ๋์— ๋†“๊ณ  ์กฐ๊ฑด์— ๋”ฐ๋ผ ๋ฐ˜๋Œ€ํŽธ์œผ๋กœ ์ด๋™์‹œํ‚ค๋ฉฐ ๋ฌผ ์–‘ ๋น„๊ต
๋‘˜ ์ค‘ ๋” ๋†’์€ ๋†’์ด๋ฅผ ์ด๋™์‹œํ‚ค๋ฉด ๋ฌด์กฐ๊ฑด ๋ฌผ์˜ ์–‘์ด ์ค„์–ด๋“ค๊ธฐ ๋•Œ๋ฌธ์— ๋” ๋‚ฎ๊ฑฐ๋‚˜ ๊ฐ™์€ ์ปค์„œ๋ฅผ ์ด๋™์‹œํ‚ค๋ฉฐ ์—…๋ฐ์ดํŠธ
๋‘˜์ด ๋งŒ๋‚˜๋ฉด ๋น„๊ต ์ข…๋ฃŒ
len(height) : N
TC : O(N)
l, r์˜ ์ด๋™์ด ์ „์ฒด height ๊ฐœ์ˆ˜๋งŒํผ ์ผ์–ด๋‚˜๋ฏ€๋กœ
SC : O(1)
"""

class Solution:
def maxArea(self, height: List[int]) -> int:
l = 0
Expand Down

0 comments on commit c934be0

Please sign in to comment.