Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions climbing-stairs/jeongyunjae.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Solution:
def climbStairs(self, n: int) -> int:
dp = [-1]

for i in range(1,n+1):
if i == 1 or i == 2:
dp.append(i)
continue

dp.append(dp[i-1] + dp[i-2])

return dp[n]
6 changes: 6 additions & 0 deletions valid-anagram/jeongyunjae.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Solution:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정렬을 사용하기 때문에 시간 복잡도가 O(n) 풀이보다 떨어질 수 있습니다 Counter 활용해보는 것도 추천합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다!

def isAnagram(self, s: str, t: str) -> bool:
sort_s = ''.join(sorted(s))
sort_t = ''.join(sorted(t))

return sort_s == sort_t