Repository navigation
[alphaorderly] WEEK 02 Solutions - #2942
Merged
Merged
Conversation
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 |
Member
There was a problem hiding this comment.
처음에 min,max가 정의가 안 되었을 때는 infinity 대신 undefined로 값 비교 자체를 건너뛰는 것이 가능하군요..!
새로운 내용 배워갑니다:)
Contributor
Author
There was a problem hiding this comment.
네! conditional 하게 줘봤어요!
| const ans: number[][] = []; | ||
|
|
||
| while (left + 2 < nums.length) { | ||
| if (nums[left] == nums[left - 1]) { |
Member
There was a problem hiding this comment.
초기에 left = 0일 때, py nums[-1]이 마지막 원소라서 i > 0 조건을 따로 넣어야 했는데, TS에서는 nums[-1]이 undefined라서 left > 0을 따로 확인하지 않아도 되는군요!
Contributor
Author
There was a problem hiding this comment.
네 맞아요! 이런부분은 확실히 다른점이 있네요 ㅎㅎ
저도 맨날 파이썬으로 풀다가 타입스크립트는 완전 처음이라 어색하기도 하구요
201411108
reviewed
Nov 21, 2026
201411108
approved these changes
Nov 21, 2026
201411108
approved these changes
Nov 21, 2026
201411108
left a comment
Contributor
There was a problem hiding this comment.
👍 반영하지 않아도 될 작은 리뷰에도 답변 달아주셔서 감사합니다!
익숙하지 않은 언어로 알고리즘을 푼다는 것이 쉽지 않을텐데 풀이를 보며 많이 배워갑니다.
고생하셨습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!