Skip to content

[alphaorderly] WEEK 02 Solutions - #2942

Merged
alphaorderly merged 3 commits into
DaleStudy:mainfrom
alphaorderly:week-02
Nov 21, 2026
Merged

alphaorderly merged 3 commits into
DaleStudy:mainfrom
alphaorderly:week-02

Conversation

@alphaorderly

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@dalestudy

dalestudy Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI 리뷰(알고리즘 패턴, 시간/공간 복잡도, 학습 현황) 결과는 Checks 탭에서 볼 수 있어요.

Comment on lines +22 to +23
if (min !== undefined && root.val <= min) return false
if (max !== undefined && root.val >= max) return false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

처음에 min,max가 정의가 안 되었을 때는 infinity 대신 undefined로 값 비교 자체를 건너뛰는 것이 가능하군요..!
새로운 내용 배워갑니다:)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

네! conditional 하게 줘봤어요!

Comment thread 3sum/alphaorderly.ts
const ans: number[][] = [];

while (left + 2 < nums.length) {
if (nums[left] == nums[left - 1]) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

초기에 left = 0일 때, py nums[-1]이 마지막 원소라서 i > 0 조건을 따로 넣어야 했는데, TS에서는 nums[-1]이 undefined라서 left > 0을 따로 확인하지 않아도 되는군요!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

네 맞아요! 이런부분은 확실히 다른점이 있네요 ㅎㅎ
저도 맨날 파이썬으로 풀다가 타입스크립트는 완전 처음이라 어색하기도 하구요

Comment thread 3sum/alphaorderly.ts Resolved
Comment thread valid-anagram/alphaorderly.ts Resolved
Comment thread valid-anagram/alphaorderly.ts Resolved

@201411108 201411108 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 반영하지 않아도 될 작은 리뷰에도 답변 달아주셔서 감사합니다!
익숙하지 않은 언어로 알고리즘을 푼다는 것이 쉽지 않을텐데 풀이를 보며 많이 배워갑니다.
고생하셨습니다.

@alphaorderly
alphaorderly merged commit 8eda2da into DaleStudy:main Nov 21, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Completed in 리트코드 스터디 9기 Nov 21, 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