Skip to content

[j2h30728] WEEK 04 Solutions#2760

Merged
DaleSeo merged 5 commits into
DaleStudy:mainfrom
j2h30728:week4-clean
Jul 19, 2026
Merged

[j2h30728] WEEK 04 Solutions#2760
DaleSeo merged 5 commits into
DaleStudy:mainfrom
j2h30728:week4-clean

Conversation

@j2h30728

@j2h30728 j2h30728 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

일주일 동안 여름휴가로 늦게 제출합니다 ㅠㅠ..

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@dalestudy

dalestudy Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

📊 j2h30728 님의 학습 현황

이번 주 제출 문제

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

누적 학습 요약

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

문제 풀이 현황

카테고리 진행도 완료
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 1,427 189 1,616 $0.000147
2 1,427 188 1,615 $0.000147
합계 2,854 377 3,231 $0.000294

Comment thread coin-change/j2h30728.ts

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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Dynamic Programming
  • 설명: 코인 교환 문제를 금액별 최솟값으로 나타내는 부분 문제의 최적해를 쌓아가는 DP 방식으로 풀이합니다. 이중 루프는 금액마다 가능한 동전을 고려해 최솟값을 갱신합니다.

📊 시간/공간 복잡도 분석

복잡도
Time O(amount * k)
Space O(amount)

피드백: 외부 반복으로 모든 금액에 대해 각 동전을 활용한 최소 개수를 갱신하는 표를 사용한다.

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

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

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, Two Pointers
  • 설명: 정렬된 배열이 회전되었을 때 최소 원소를 찾기 위해 이분탐색으로 구간을 반으로 좁혀 가는 패턴이며, 좌우 포인터를 사용하여 탐색 범위를 조절합니다.

📊 시간/공간 복잡도 분석

복잡도
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(n)

피드백: 트리의 모든 노드를 한 번씩 방문하며 최대 깊이를 계산한다.

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

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

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, Merge
  • 설명: 리스트를 두 포인터(list1, list2)로 순회하며 작은 값을 차례대로 연결하는 방식으로 해결하는 패턴입니다. 남은 부분도 한 번의 연결으로 처리하므로 두 포인터의 이동과 연결이 핵심입니다.

📊 시간/공간 복잡도 분석

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

피드백: 두 리스트의 노드를 직접 연결해서 합친 뒤 남은 부분을 붙인다.

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

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

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

수고하셨습니다. 남은 문제인 word search도 풀어보시면 좋을 거 같아요.

@@ -0,0 +1,12 @@
function findMin(nums: number[]): number {
const n = nums.length - 1;

@parkhojeong parkhojeong Jul 19, 2026

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.

변수 명으로 n을 사용하신 이유가 있을까요?

Comment thread coin-change/j2h30728.ts
Comment on lines +2 to +13
const dp = new Array(amount + 1).fill(amount + 1);
dp[0] = 0;

for (let i = 1; i <= amount; i++) {
for (const coin of coins) {
if (i - coin >= 0) {
dp[i] = Math.min(dp[i], 1 + dp[i - coin]);
}
}
}

return dp[amount] > amount ? -1 : dp[amount];

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.

amount + 1, > amount 이 연관된 로직인데 드러나지 않아서 amount + 1 을 변수로 선언해서 사용하시면 좋을 거 같아요.

Comment on lines +3 to +9
let last = nums[n];
let left = 0, right = n;

while(left < right){
const mid = (left + right) >> 1;
if(nums[mid] > last) left = mid + 1;
else right = mid;

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.

이진탐색인데 last가 고정되어 있네요. 잘 이해가 안되서 그런데 이 부분 설명해주실 수 있을까요?

@DaleSeo
DaleSeo merged commit b8c50cc into DaleStudy:main Jul 19, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Review to Completed in 리트코드 스터디 8기 Jul 19, 2026
okyungjin pushed a commit to okyungjin/leetcode-study that referenced this pull request Jul 20, 2026
* week4: 104. Maximum Depth of Binary tree

* week4: 21. Merge Two Sorted Lists

* week4: 153. Find Minimum in Rotated Sorted Array

* week4: 322. Coin Change

* fix: add trailing newline to week4 solution files
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