-
-
Notifications
You must be signed in to change notification settings - Fork 304
[hongseoupyun] Week 02 solutions #2071
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
Conversation
seungriyou
left a comment
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의 status를 In Review로 바꿔주시면 더 빠른 리뷰가 가능합니다!)
|
|
||
| prev1 = 1 | ||
| prev2 = 2 | ||
| for i in range(n,n+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.
range(n, n+1)이라면 루프가 딱 한 번만 실행될 것 같아요! range(3, n+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.
|
|
||
|
|
||
| //Time complexity is O(n) - loops n times | ||
| //Space complexity is O(1) — memorizes only prev1 & prev2 |
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 테이블 없이 변수 2개만 유지함으로써 공간 복잡도를 최적화하셨네요! 👍🏻
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!