-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[재호] WEEK 03 Solutions #375
Conversation
wogha95
commented
Aug 25, 2024
•
edited
Loading
edited
- Two Sum #219
- Climbing Stairs #230
- Product of Array Except Self #239
- Combination Sum #254
- Coin Change #269
@@ -0,0 +1,21 @@ | |||
// DP 활용하였고 메모리 축소를 위해 현재와 직전의 경우의 수만 관리하였습니다. | |||
// TC: O(N) | |||
// SC: O(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
공간 복잡도를 줄일 수 있는 좋은 풀이네요! 고생하셨습니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조금 의아한 시간 복잡도 분석이 있어서 코멘트 남겼습니다. PR 승인에는 문제가 없을 것 같습니다. 답안 빨리 제출해주셔서 감사합니다!
|
||
// 1차 | ||
// dfs를 활용하여 각 요소를 추가 -> 재귀 -> 제거로 순회합니다. | ||
// TC: O(C^T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시간 복잡도를 어떻게 O(C^T)
로 분석하셨을까요? dfs()
함수 내에서 재귀 호출이 2번씩 일어나는 것 같아서 여쭙니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다!