Skip to content

[jjipper] WEEK 01 solutions#2395

Merged
jjipper merged 3 commits intoDaleStudy:mainfrom
jjipper:WEEK01
Mar 8, 2026
Merged

[jjipper] WEEK 01 solutions#2395
jjipper merged 3 commits intoDaleStudy:mainfrom
jjipper:WEEK01

Conversation

@jjipper
Copy link
Contributor

@jjipper jjipper commented Mar 8, 2026

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@jjipper jjipper moved this from Solving to In Review in 리트코드 스터디 7기 Mar 8, 2026
@jjipper
Copy link
Contributor Author

jjipper commented Mar 8, 2026

@DaleStudy 리뷰해줘

@dalestudy
Copy link
Contributor

dalestudy bot commented Mar 8, 2026

전체적으로 깔끔하고 효율적인 코드입니다! 시간과 공간 복잡도도 잘 표기되어 있으며, 두 문제 모두 최적의 해법을 사용하고 있어 좋은 접근입니다. 몇 가지 제안드리자면:

  1. 가독성 향상: 함수에 간단한 설명 또는 인라인 코멘트를 추가하면 읽는 사람이 더 이해하기 쉬워집니다. 특히, 두 번째 문제의 경우 "Hash Map을 이용한 Two Sum"과 같은 간단한 설명을 넣어도 좋습니다.

  2. 코드 스타일: 타입 선언을 명확히 하는 점이 좋습니다. 일관된 포맷 유지도 좋아요.

  3. 추가 제안: 두 문제 모두 시간 복잡도 O(n), 공간 복잡도 O(n)으로 최적화됐으며, 이보다 더 좋은 방법은 없습니다. 하지만, 작은 최적화로는 containsDuplicate에서는 Set을 사용할 때 has 호출을 바로 반환하는 구조를 유지하는 것도 좋고, twoSumMap 대신 Object를 사용했는데, 이 부분도 충분히 표준적입니다.

전반적으로 잘 작성된 코드입니다! 앞으로도 이런 깔끔한 솔루션 기대할게요. 계속해서 개선하는 습관이 멋집니다!

@DaleStudy DaleStudy deleted a comment from dalestudy bot Mar 8, 2026
@jjipper
Copy link
Contributor Author

jjipper commented Mar 8, 2026

@DaleStudy 승인

Copy link
Contributor

@dalestudy dalestudy bot left a comment

Choose a reason for hiding this comment

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

승인되었습니다! 👍

@jjipper jjipper merged commit b12f412 into DaleStudy:main Mar 8, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 7기 Mar 8, 2026
Copy link
Contributor

@dohyeon2 dohyeon2 left a comment

Choose a reason for hiding this comment

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

전반적으로 깔끔한 풀이입니다!

if (seen.has(num)) {
return true;
}
seen.add(num);
Copy link
Contributor

Choose a reason for hiding this comment

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

이 방식이라면 Set에 모든 숫자를 넣지 않는 경우도 생겨서
모두 넣고 사이즈를 비교하는 방식보다 효율적일 것 같습니다.
의미도 명확해서 좋은 풀이인 것 같네요!

for (let i = 0; i < nums.length; i++) {
const a = nums[i];
const b = target - a;
if (b in obj) {
Copy link
Contributor

Choose a reason for hiding this comment

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

깔끔한 풀이네요.
변수명을 보다 의미있게 작성하면 가독성에 도움이 될 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

앗 그러네요 변수명도 의미있게 작성하도록 신경써야겠습니다.
좋은 피드백 감사드립니다 도현님! 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants