Skip to content
Open
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
11 changes: 11 additions & 0 deletions climbing-stairs/Yiseull.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🏷️ 알고리즘 패턴 분석

  • 패턴: Dynamic Programming
  • 설명: 클라이밍 스텝스 문제는 현재 계단 수를 이전 두 단계의 합으로 구하는 전형적인 DP 점화식 전략이다. dp 배열로 중복 계산을 피하고 점화식을 통해 최단 경로를 계산한다.

📊 시간/공간 복잡도 분석

복잡도
Time O(n)
Space O(n)

피드백: 배열 dp를 이용해 각 위치의 경우의 수를 기록하며 중복 계산을 피한다.

개선 제안: 현재 구현이 적절해 보입니다.

💡 풀이에 시간/공간 복잡도를 주석으로 남겨보세요!

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution:
def climbStairs(self, n: int) -> int:
if n == 1: return 1

dp = [0 for _ in range(n + 1)]
dp[0], dp[1] = 1, 1

for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]

return dp[n]
5 changes: 5 additions & 0 deletions valid-anagram/Yiseull.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🏷️ 알고리즘 패턴 분석

  • 패턴: Hash Map / Hash Set, Trie, Dynamic Programming
  • 설명: 두 문자열의 문자 분포를 비교하기 위해 해시 기반 카운터를 사용합니다. Counter를 이용한 빈도 비교는 해시 맵 패턴의 대표적 사례이며, 문자 구성의 동일성 여부를 빠르게 판단합니다.

📊 시간/공간 복잡도 분석

복잡도
Time O(n + m)
Space O(k)

피드백: Counter를 이용해 문자 수를 비교하므로 직관적이고 간단하다.

개선 제안: 현재 구현이 적절해 보입니다.

💡 풀이에 시간/공간 복잡도를 주석으로 남겨보세요!

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from collections import Counter

class Solution:
def isAnagram(self, s: str, t: str) -> bool:
return Counter(s) == Counter(t)
Loading