-
-
Notifications
You must be signed in to change notification settings - Fork 195
[호돌이] Week2 #729
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
[호돌이] Week2 #729
Conversation
*/ | ||
var climbStairs = function (n) { | ||
// n+1 배열을 만들고 0으로 초기화 | ||
const dp = new Array(n + 1).fill(0); |
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.
배열 선언에서 .fill(0)
부분은 없어도 괜찮지 않을까 궁금합니다!
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.
정수가 들어갈 자리라서 미리 0으로 초기화했었는데 안해도 상관은 없을거같긴 합니다.
한번 찾아보겠습니다!
}; | ||
|
||
// Map을 사용해서 데이터 최신화 | ||
let count = new Map(); |
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.
map 대신 알파벳 만큼인 26짜리 배열 하나만을 사용해서 풀이하는 방법도 있을것 같아요!
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.
2주차 문제풀이 고생 많으셨습니다!
문제에 따라서 최적화 과정을 설명과 함께 적어주셔서 이해하는데 더 도움이 된 것 같아요.
3주차도 파이팅입니다!
리뷰로 도움드리진 못했습니다만, 3주차도 같이 화이팅 하면 좋을것 같습니다..! |
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.