-
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
[HerrineKim] Week 4 #826
[HerrineKim] Week 4 #826
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.
안녕하세요 새해복 많이 받으세요
Js는 다뤄본적이 없어 잘 모르지만 리뷰하면서 열심히 배워보겠습니다
잘 부탁드려요
missing-number/HerrineKim.js
Outdated
* @return {number} | ||
*/ | ||
var missingNumber = function(nums) { | ||
const numSet = new Set(nums); |
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 자료구조로 데이터 조회 시간복잡도를 O(1)로 처리하신 부분이 좋아보여요 👍
메모리를 좀 더 활용하게 되어서 공간복잡도가 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.
@GangBean 가우스 덧셈 공식을 사용해 최적화해봤습니다! 🙇
새해 복 많이 받으세요! 😄 리뷰 감사합니다. 다른 문제 풀면서 리뷰도 함께 살펴보겠습니다! |
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.
이번 한 주도 고생하셨습니다! 남은 기간도 화이팅하세요!
missing-number/HerrineKim.js
Outdated
const numSet = new Set(nums); | ||
|
||
for (let i = 0; i <= nums.length; i++) { | ||
if (!numSet.has(i)) { |
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.
이건 언어에 대한 제 조그만 궁금증인데.. 변수 타입 예약어가 var, const, let 3가지가 보여서요. 어떤 차이가 있는 건지 궁금하네요 🤔
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.
이건 언어에 대한 제 조그만 궁금증인데.. 변수 타입 예약어가 var, const, let 3가지가 보여서요. 어떤 차이가 있는 건지 궁금하네요 🤔
@GangBean 몇 가지 차이들이 있는데, 가장 중요한 차이점은 var는 업데이트, 재선언 모두 가능, let은 업데이트만 가능, const는 둘 다 불가능하다 이게 가장 큰 특징인 것 같습니다 😄 (요 글 참고해서 알아보았네요: https://www.freecodecamp.org/korean/news/var-let-constyi-caijeomeun/)
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 로 잘 풀어주셨네요! 👍
var missingNumber = function(nums) { | ||
const n = nums.length; | ||
// 0부터 n까지의 합 공식: n * (n + 1) / 2 | ||
const expectedSum = (n * (n + 1)) / 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.
제가 리뷰 의도드린 대로 풀어주셨네요! 👍
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.