-
Notifications
You must be signed in to change notification settings - Fork 120
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
[kayden] Week 07 Solutions #487
Conversation
* } | ||
*/ | ||
// 시간복잡도: O(N) | ||
// 공간복잡도: 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.
반복문 내에서 새로운 ListNode를 만들어내기 때문에 공간 복잡도 또한 N에 비례하여 선형적으로 증가할 것 같습니다
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.
이번 한 주도 고생 많으셨습니다!
풀이가 깔끔하고 복잡도 분석도 코멘트 남길만한 게 없었습니다 :) Set Matrix Zeros는 공간 복잡도를 O(1)으로 푸는 방법이 있으니 일독 추천드립니다
dp = [1] * n | ||
|
||
for _ in range(1, m): | ||
for j in range(1, n): | ||
dp[j] = dp[j-1] + dp[j] |
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.
오 그렇네요 좋은 풀이 감사합니다!
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.
고생 하셨습니다~! 풀이해주신 것 보고 배웠습니다!
dp = [1] * n | ||
|
||
for _ in range(1, m): | ||
for j in range(1, n): | ||
dp[j] = dp[j-1] + dp[j] |
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.
오 그렇네요 좋은 풀이 감사합니다!
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.