-
-
Notifications
You must be signed in to change notification settings - Fork 204
[lhc0506] WEEK 1 solutions #1169
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
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.
안녕하세요 🥰
전반적으로 코드가 깔끔해서 가독성이 너무 좋네요.
나머지 3문제도 어떻게 푸실지 기대됩니다 👍
파일의 마지막에 개행 문자를 추가해주시면 좋을거 같습니다
답안-제출-가이드 참고해보세요!
안녕하세요 리뷰 감사드립니다! |
옷!! 제가 착각했나봅니다 😅 |
while(numSet.has(currentNum)) { | ||
numSet.delete(currentNum) | ||
currentNum += 1; | ||
currentLength += 1; | ||
} | ||
|
||
currentNum = num - 1; | ||
while(numSet.has(currentNum)) { | ||
numSet.delete(currentNum) | ||
currentNum -= 1; | ||
currentLength += 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.
O(n)으로 구현을 잘하신거 같네요 👍👍
while문 두 개가 currentNum += 1
, currentNum +=(-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.
a6a966b ✅
꼼꼼한 리뷰 감사합니다!
let twoBefore = 0; | ||
let oneBefore = 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.
변수 두개로 공간 복잡도를 줄이니 가독성이 좋네요 👏
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!