Skip to content

Conversation

HerrineKim
Copy link
Contributor

@HerrineKim HerrineKim commented Jan 1, 2025

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@HerrineKim HerrineKim requested a review from a team as a code owner January 1, 2025 11:42
@github-actions github-actions bot added the js label Jan 1, 2025
@HerrineKim HerrineKim requested a review from GangBean January 1, 2025 11:43
Copy link
Contributor

@GangBean GangBean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 새해복 많이 받으세요
Js는 다뤄본적이 없어 잘 모르지만 리뷰하면서 열심히 배워보겠습니다
잘 부탁드려요

* @return {number}
*/
var missingNumber = function(nums) {
const numSet = new Set(nums);
Copy link
Contributor

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) 로 더 최적화 할 수 있는 방법은 없을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GangBean 가우스 덧셈 공식을 사용해 최적화해봤습니다! 🙇

@HerrineKim
Copy link
Contributor Author

안녕하세요 새해복 많이 받으세요 Js는 다뤄본적이 없어 잘 모르지만 리뷰하면서 열심히 배워보겠습니다 잘 부탁드려요

새해 복 많이 받으세요! 😄 리뷰 감사합니다. 다른 문제 풀면서 리뷰도 함께 살펴보겠습니다!

Copy link
Contributor

@GangBean GangBean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번 한 주도 고생하셨습니다! 남은 기간도 화이팅하세요!

const numSet = new Set(nums);

for (let i = 0; i <= nums.length; i++) {
if (!numSet.has(i)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 언어에 대한 제 조그만 궁금증인데.. 변수 타입 예약어가 var, const, let 3가지가 보여서요. 어떤 차이가 있는 건지 궁금하네요 🤔

Copy link
Contributor Author

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/)

Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 리뷰 의도드린 대로 풀어주셨네요! 👍

@HerrineKim HerrineKim merged commit 41a2c03 into DaleStudy:main Jan 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants