Skip to content

Commit

Permalink
docs: 리뷰 반영 - method 가 여러개일 경우 시공간 복잡도 계산 각각 진행
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaedie committed Jan 18, 2025
1 parent 8b31585 commit 6eccf0f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions encode-and-decode-strings/Chaedie.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
1) encode: 각 글자의 앞에 글자수와 # 라는 delimiter 를 붙여 stringify 한다.
2) decode: length 를 참고삼아 word를 따내어 result 배열을 만든다.
Time: O(n)
Space: O(n)
encode:
Time: O(n) (n: strs 배열의 길이만큼 연산)
Space: O(1)
decode:
Time: O(n) (n: s 의 길이만큼 연산)
Space: O(m) (m: decode 이후 배열의 길이)
"""


Expand Down

0 comments on commit 6eccf0f

Please sign in to comment.