Skip to content

Conversation

imsosleepy
Copy link
Contributor

@imsosleepy imsosleepy commented Dec 16, 2024

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@imsosleepy imsosleepy self-assigned this Dec 16, 2024
@imsosleepy imsosleepy requested a review from a team as a code owner December 16, 2024 01:03
Comment on lines +5 to +24
public int climbStairs(int n) {
return dfs(n, new HashMap<>());
}

private int dfs(int n, Map<Integer, Integer> memo) {
if (n == 0) {
return 1;
}
if (n < 0) {
return 0;
}
if (memo.containsKey(n)) {
return memo.get(n);
}

int result = dfs(n - 1, memo) + dfs(n - 2, memo);
memo.put(n, result);

return result;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

DP만 생각했는데 DFS 풀이가 참신한것 같습니다 :)

Comment on lines +24 to +25
arr[s.charAt(i) - 97]++;
arr[t.charAt(i) - 97]--;
Copy link
Contributor

Choose a reason for hiding this comment

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

97 대신 'a' 를 쓰시면 좀 더 직관적으로 다가올것 같아요!

Copy link
Contributor

@TonyKim9401 TonyKim9401 left a comment

Choose a reason for hiding this comment

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

2주차 문제풀이도 수고 많으셨습니다!
3주차에도 좋은 문제풀이 부탁드립니다 :)

@imsosleepy imsosleepy merged commit fe2a645 into DaleStudy:main Dec 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants