Skip to content

[dohyeon2] WEEK 02 solutions#2396

Merged
dohyeon2 merged 7 commits intoDaleStudy:mainfrom
dohyeon2:week2
Mar 14, 2026
Merged

[dohyeon2] WEEK 02 solutions#2396
dohyeon2 merged 7 commits intoDaleStudy:mainfrom
dohyeon2:week2

Conversation

@dohyeon2
Copy link
Contributor

@dohyeon2 dohyeon2 commented Mar 8, 2026

답안 제출 문제

#230 문제풀이

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

dohyeon2 added 3 commits March 9, 2026 03:13
Add time and space complexity comments to climbStairs method
Refactor comments in 3Sum solution for clarity and consistency
first approach

second approach

children solution

update comments

개행문자 삽입

Update comments in validate-binary-search-tree solution for clarity

Enhance comment clarity in validate-binary-search-tree solution
@SamTheKorean
Copy link
Contributor

@DaleStudy 리뷰해줘

@dalestudy
Copy link
Contributor

dalestudy bot commented Mar 14, 2026

좋은 작업입니다! 여러 문제를 깔끔하게 해결했고, 특히 시간/공간 복잡도에 대한 주석도 명확하게 달아두셨네요. 몇 가지 개선 제안을 드리자면:

  1. 복잡도 표기 수정: threeSum에서 SC를 O(1)로 표기하셨는데, 정렬 후 답변을 저장하는 답 리스트를 사용하는 만큼, 최악의 경우 답 리스트 크기가 O(n^2)이 될 수 있어요. 따라서 SC: O(n^2)로 수정하는 게 더 정확합니다.

  2. 불필요한 변수 제거: climbStairs에서는 nZero 대신 n이라는 변수명을 사용할 수도 있고, 현재 구조도 명확하지만, 변수명만 조금 더 직관적으로 바꿀 수 있겠습니다.

  3. 가독성 향상: productExceptSelf에서 filterreduce를 쓰셨는데, 내부 람다에서 변수 이름이 n인 것이 다소 일반적이어서 num으로 바꾸면 더 명확할 것 같아요. 또한 Arrays.stream(nums).map(...).toArray()는 가독성을 위해 별도 함수로 분리하는 것도 고려해볼 수 있습니다.

  4. BST 검증: validate-binary-search-tree 구현은 깔끔하고 효과적입니다. 재귀 호출로 범위 검증을 하는 방식은 추천할 만하며, 시간/공간 복잡도도 적절하게 표기하셨습니다.

전반적으로 매우 잘 구성되어 있고, 주석도 명확하며, 깔끔한 스타일입니다. 앞으로도 다양한 문제를 이렇게 체계적으로 해결한다면 더욱 실력이 향상될 거예요! 계속해서 좋은 코드 기대하겠습니다.

Copy link
Contributor

@jiji-hoon96 jiji-hoon96 left a comment

Choose a reason for hiding this comment

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

고생많으셨습니다!

알고리즘 해결 방법이 정석적이고, 시간복잡도 최적화를 위해 많이 고민하신 것 같네요
코드 구조도 깔끔하고 너무 좋습니다!

}

return Arrays.stream(nums).map((n) -> {
return production / n;
Copy link
Contributor

Choose a reason for hiding this comment

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

division 제약 조건인걸로 알고있습니다!!
한번 확인해보시면 좋을 것 같아요

Copy link
Contributor Author

@dohyeon2 dohyeon2 Mar 14, 2026

Choose a reason for hiding this comment

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

...without using the division operation.

역시 사람 말은 끝까지 들어야하네요.
알려주셔서 감사합니다!
다시 올바른 방법으로 풀어볼게요

Comment on lines +45 to +49
if (sum < 0) {
left++;
}
if (sum > 0) {
right--;
Copy link
Contributor

Choose a reason for hiding this comment

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

sum == 0 도 처리하고있어보여요.
if/else 문으로 바꾸면 좋겠습니다~

Copy link
Contributor Author

@dohyeon2 dohyeon2 Mar 14, 2026

Choose a reason for hiding this comment

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

sum == 0 이후에도 계속해서 조건 체크가 일어난다는 말씀이시죠?
해당 부분 개선해보겠습니다~

… in 3Sum solution

Refine space complexity comment in 3Sum solution for accuracy
Add missing newline at the end of the file in dohyeon2.java
@dohyeon2 dohyeon2 merged commit 552eb32 into DaleStudy:main Mar 14, 2026
1 check passed
@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