Skip to content

[seongmin36] WEEK 04 Solutions - #2747

Merged
seongmin36 merged 5 commits into
DaleStudy:mainfrom
seongmin36:week04
Jul 18, 2026
Merged

[seongmin36] WEEK 04 Solutions#2747
seongmin36 merged 5 commits into
DaleStudy:mainfrom
seongmin36:week04

Conversation

@seongmin36

@seongmin36 seongmin36 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@dalestudy

dalestudy Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

📊 seongmin36 님의 학습 현황

이번 주 제출 문제

문제 난이도 유형 분석
find-minimum-in-rotated-sorted-array Medium ✅ 의도한 유형
maximum-depth-of-binary-tree Easy ✅ 의도한 유형
merge-two-sorted-lists Easy ✅ 의도한 유형

누적 학습 요약

  • 풀이한 문제: 15 / 75개
  • 이번 주 유형 일치율: 100% (3문제 중 3문제 일치)

문제 풀이 현황

카테고리 진행도 완료
Array ■■■■□□□ 5 / 10 (Medium 3, Easy 2)
Dynamic Programming ■■■□□□□ 4 / 11 (Easy 1, Medium 3)
Heap ■■□□□□□ 1 / 3 (Medium 1)
Binary ■□□□□□□ 1 / 5 (Easy 1)
String ■□□□□□□ 2 / 10 (Easy 2)
Graph ■□□□□□□ 1 / 8 (Medium 1)
Tree ■□□□□□□ 1 / 14 (Medium 1)
Interval □□□□□□□ 0 / 5 ← 아직 시작 안 함
Linked List □□□□□□□ 0 / 6 ← 아직 시작 안 함
Matrix □□□□□□□ 0 / 4 ← 아직 시작 안 함

🤖 이 댓글은 GitHub App을 통해 자동으로 작성되었습니다.

🔢 API 사용량 (gpt-5-nano)
요청 입력 토큰 출력 토큰 합계 비용
1 988 74 1,062 $0.000079
2 1,217 143 1,360 $0.000118
3 1,264 111 1,375 $0.000108
합계 3,469 328 3,797 $0.000305

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.

O(1) 공간복잡도와 O(N) 시간복잡도로도 해결하실수 있으세요! 한번 시도해보시는것도 좋겠네요

@seongmin36 seongmin36 moved this from Solving to In Review in 리트코드 스터디 8기 Jul 17, 2026
@tigermint
tigermint self-requested a review July 18, 2026 11:25

@parkhojeong parkhojeong 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.

수고하셨습니다. 코드가 간결해서 좋네요!

Comment on lines +15 to +18
while (left < right) {
let mid = Math.floor((left + right) / 2);

if (nums[mid] > nums[right]) {

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.

탐색 과정에서 정답으로 판정할 수 있는 경우가 있어서 한 번 최적화 시도해보셔도 좋을 거 같습니다.

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 on lines +24 to +26
let count = Math.max(left_depth, right_depth) + 1;

return count;

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.

count 보단 maxDepth 와 같은 네이밍이 더 적절할 거 같은데 함수명이랑 겹쳐서 인라인해도 괜찮을 거 같습니다.

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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Binary Search
  • 설명: 회전된 정렬 배열에서 최소값을 이진 탐색으로 찾는 알고리즘으로, 중간 인덱스를 확인해 탐색 구간을 반으로 축소한다. O(log n)의 시간 복잡도와 O(1)의 공간 복잡도를 갖는다.

📊 시간/공간 복잡도 분석

복잡도
Time O(log n)
Space O(1)

피드백: 중간값 비교를 통해 회전점 인근으로 범위를 점진 축소한다. 공통적으로 좌우 중 어느 쪽이 더 큰지에 따라 탐색 구간을 반으로 줄인다.

개선 제안: 현재 구현이 적절해 보입니다.

💡 풀이에 시간/공간 복잡도를 주석으로 남겨보세요!

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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Depth-First Search, Binary Search
  • 설명: 코드는 이진 트리를 재귀적으로 좌우로 탐색하며 깊이를 구한다. 자식 노드로의 탐색은 DFS의 전형적 형태이고, 재귀를 통한 깊이 축적이 핵심이다.

📊 시간/공간 복잡도 분석

복잡도
Time O(n)
Space O(h)

피드백: 리프까지 모든 노드를 한 번씩 방문하며 재귀로 깊이를 계산한다. 최악의 경우 트리의 높이가 공간 복잡도에 영향

개선 제안: 현재 구현이 적절해 보입니다.

💡 풀이에 시간/공간 복잡도를 주석으로 남겨보세요!

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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Two Pointers, Linked List
  • 설명: 두 정렬 리스트를 하나로 합치기 위해 두 포인터(list1,list2)로 값을 비교하고 작은 노드를 차례대로 연결하는 전형적인 투 포인터 방식의 연결 리스트 병합 패턴.

📊 시간/공간 복잡도 분석

복잡도
Time O(n)
Space O(1)

피드백: 가상 머리(dummy) 노드를 사용해 비교하며 결과를 구성한다. 남은 노드를 연결하는 부분까지 일관되게 처리

개선 제안: 현재 구현이 적절해 보입니다.

💡 풀이에 시간/공간 복잡도를 주석으로 남겨보세요!

@seongmin36
seongmin36 merged commit 5a7ca16 into DaleStudy:main Jul 18, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Review to Completed in 리트코드 스터디 8기 Jul 18, 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