Skip to content

[jiji-hoon96] WEEK 02 solutions #2397

Merged
jiji-hoon96 merged 5 commits intomainfrom
jiji-hoon96/week2
Mar 14, 2026
Merged

[jiji-hoon96] WEEK 02 solutions #2397
jiji-hoon96 merged 5 commits intomainfrom
jiji-hoon96/week2

Conversation

@jiji-hoon96
Copy link
Contributor

@jiji-hoon96 jiji-hoon96 commented Mar 9, 2026

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

- valid-anagram
- climbing-stairs
@github-actions github-actions bot added the ts label Mar 9, 2026
@jiji-hoon96 jiji-hoon96 changed the title Jiji hoon96/week2 [jiji-hoon96] WEEK 02 solutions Mar 9, 2026
@Cyjin-jani Cyjin-jani self-requested a review March 9, 2026 11:32
- product-of-array-except-self
- 3sum
- validate-binary-search-tree
@jiji-hoon96 jiji-hoon96 moved this from Solving to In Review in 리트코드 스터디 7기 Mar 12, 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.

전반적으로 풀이가 깔끔하네요
3Sum에 부르트포스 접근도 과정이 보여서 흥미롭게 봤습니다.
TC, SC 분석도 함께 남기면 더 공부가 될것같습니다!
3Sum의 새로운 답이 통과 된 이유도 명확해질것같아요.

return dfs(node.left, min, node.val) && dfs(node.right, node.val, max);
}

return dfs(root, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);
Copy link
Contributor

Choose a reason for hiding this comment

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

Number에 이런 상수가 있는걸 이제 알았네요
배워갑니다~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

자동완성의 힘 좋네요 ㅋㅋ

Copy link
Contributor

@Cyjin-jani Cyjin-jani left a comment

Choose a reason for hiding this comment

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

2주차 문제 풀이 고생 많으셨습니다🙌

Comment on lines +14 to +18
// const hasArray = result.some(
// (item) =>
// JSON.stringify([...item].sort((a, b) => a - b)) ===
// JSON.stringify([nums[i], nums[j], nums[k]].sort((a, b) => a - b)),
// );
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.

비록 시간복잡도에서 타임 리밋 걸리긴했지만 저런 방법도 있었습니다

Comment on lines +61 to +69
threeSum([
12, 5, -12, 4, -11, 11, 2, 7, 2, -5, -14, -3, -3, 3, 2, -10, 9, -15, 2, 14,
-3, -15, -3, -14, -1, -7, 11, -4, -11, 12, -15, -14, 2, 10, -2, -1, 6, 7, 13,
-15, -13, 6, -10, -9, -14, 7, -12, 3, -1, 5, 2, 11, 6, 14, 12, -10, 14, 0, -7,
11, -10, -7, 4, -1, -12, -13, 13, 1, 9, 3, 1, 3, -5, 6, 9, -4, -2, 5, 14, 12,
-5, -6, 1, 8, -15, -10, 5, -15, -2, 5, 3, 3, 13, -8, -13, 8, -5, 8, -6, 11,
-12, 3, 0, -2, -6, -14, 2, 0, 6, 1, -11, 9, 2, -3, -6, 3, 3, -15, -5, -14, 5,
13, -4, -4, -10, -10, 11,
]); // [[-15,1,14],[-15,2,13],[-15,3,12],[-15,4,11],[-15,5,10],[-15,6,9],[-15,7,8],[-14,0,14],[-14,1,13],[-14,2,12],[-14,3,11],[-14,4,10],[-14,5,9],[-14,6,8],[-14,7,7],[-13,-1,14],[-13,0,13],[-13,1,12],[-13,2,11],[-13,3,10],[-13,4,9],[-13,5,8],[-13,6,7],[-12,-2,14],[-12,-1,13],[-12,0,12],[-12,1,11],[-12,2,10],[-12,3,9],[-12,4,8],[-12,5,7],[-12,6,6],[-11,-3,14],[-11,-2,13],[-11,-1,12],[-11,0,11],[-11,1,10],[-11,2,9],[-11,3,8],[-11,4,7],[-11,5,6],[-10,-4,14],[-10,-3,13],[-10,-2,12],[-10,-1,11],[-10,0,10],[-10,1,9],[-10,2,8],[-10,3,7],[-10,4,6],[-10,5,5],[-9,-5,14],[-9,-4,13],[-9,-3,12],[-9,-2,11],[-9,-1,10],[-9,0,9],[-9,1,8],[-9,2,7],[-9,3,6],[-9,4,5],[-8,-6,14],[-8,-5,13],[-8,-4,12],[-8,-3,11],[-8,-2,10],[-8,-1,9],[-8,0,8],[-8,1,7],[-8,2,6],[-8,3,5],[-8,4,4],[-7,-7,14],[-7,-6,13],[-7,-5,12],[-7,-4,11],[-7,-3,10],[-7,-2,9],[-7,-1,8],[-7,0,7],[-7,1,6],[-7,2,5],[-7,3,4],[-6,-6,12],[-6,-5,11],[-6,-4,10],[-6,-3,9],[-6,-2,8],[-6,-1,7],[-6,0,6],[-6,1,5],[-6,2,4],[-6,3,3],[-5,-5,10],[-5,-4,9],[-5,-3,8...
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.

릿코드 테스트 케이스 복사해왔습니다 ㅋㅋ

@@ -0,0 +1,26 @@
function isAnagram(s: string, t: string): boolean {
if (s.length !== t.length) return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

빠른 예외 처리 좋네요 👍👍

Comment on lines +15 to +19
for (const value in list) {
if (list[value] > 0) {
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

이미 충분히 괜찮은 방법입니다만, 3번째 for문을 없애고 조금 더 빠르게 만들 수 있을 듯 합니다!🤔

이미 s와 t의 길이가 같다보니 아래처럼 t의 문자가 list에 없거나 값이 이미 0인 경우 바로 false를 반환하도록 수정할 수도 있을 것 같아요..!

for (const key of t) {
    if (!list[key]) {
      return false;
    }
    list[key] -= 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.

오.. 생각해보지 못했는데, 좋은 방법이네요
한번 돌려봐야겠어요!! 좋은 의견 너무 감사합니다~

@jiji-hoon96 jiji-hoon96 merged commit 9c77d19 into main Mar 14, 2026
1 check passed
@jiji-hoon96 jiji-hoon96 deleted the jiji-hoon96/week2 branch March 14, 2026 02:52
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 7기 Mar 14, 2026
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.

3 participants