Skip to content

[ICE0208] WEEK 04 Solutions - #2744

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

[ICE0208] WEEK 04 Solutions #2744
ICE0208 merged 5 commits into
DaleStudy:mainfrom
ICE0208:week04

Conversation

@ICE0208

@ICE0208 ICE0208 commented Jul 14, 2026

Copy link
Copy Markdown
Member

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@dalestudy

dalestudy Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📊 ICE0208 님의 학습 현황

이번 주 제출 문제

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

누적 학습 요약

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

문제 풀이 현황

카테고리 진행도 완료
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 474 37 511 $0.000039
2 2,356 220 2,576 $0.000206
합계 2,830 257 3,087 $0.000244

Comment thread coin-change/ICE0208.java

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 * coins.length) O(amount * number_of_coins)
Space O(amount) O(amount)

피드백: dp 배열을 구성해 각 합을 만들기 위한 최소 동전 수를 갱신한다. 각 금액에 대해 모든 동전을 시도하므로 전체 시간은 금액과 코인 수의 곱에 비례한다.

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

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
  • 설명: 배열의 회전 여부를 조건으로 중간 값을 기준으로 구간을 반으로 좁히며 최솟값 위치를 찾는 이진 탐색 패턴을 사용합니다. 특정 조건에 따라 왼쪽/오른쪽 부분배열을 재귀적으로 탐색합니다.

📊 시간/공간 복잡도 분석

복잡도
Time O(log n)
Space O(log 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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Depth-First Search, Divide and Conquer
  • 설명: 재귀적으로 좌우 자식 노드를 방문하며 깊이를 계산하는 구조로, 트리의 최대 깊이를 구하는 문제는 DFS로 해결되고, 분할된 문제를 합쳐 최종 결과를 얻는 형태(Divide and Conquer)로 볼 수 있습니다.

📊 시간/공간 복잡도 분석

복잡도
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 + m)
Space O(1)

피드백: 두 리스트를 병합하면서 각 노드 포인터를 차례로 연결한다. 추가 노드 생성 없이 재사용한다.

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

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

Comment thread word-search/ICE0208.java

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, Backtracking, Trie
  • 설명: DFS를 이용해 인접 칸으로 이동하며 단어의 각 글자를 맞춰 탐색하고, 방문 배열로 경로를 추적하는 백트래킹 방식의 해법이다.

📊 시간/공간 복잡도 분석

복잡도
Time O(4^(L) * N*M)
Space O(N*M)

피드백: 시작 위치에서 DFS를 통해 인접 칸으로 탐색하며 방문 여부를 추적한다.

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

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

@ICE0208 ICE0208 moved this from Solving to In Review in 리트코드 스터디 8기 Jul 18, 2026
@okyungjin
okyungjin self-requested a review July 18, 2026 12:41

@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 thread coin-change/ICE0208.java

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

Choose a reason for hiding this comment

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

dfs 로 풀어주셨네요. while 문을 사용하시면 좀 더 간결하게 작성이 가능할 거 같아서 시도해보셔도 좋을 거 같습니다.

Comment thread word-search/ICE0208.java

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.

요거 돌려보니 runtime이 하위 20~30% 정도로 나와서 최적화 좀 더 시도해보셔도 좋을 거 같습니다. 불필요한 탐색 과정을 사전에 정리하는 방식으로 접근해보시면 될 거 같습니다.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

직접 돌려주시기까지 하시다니 꼼꼼한 리뷰 감사합니다!
복습하면서 더 최적화해보도록 하겠습니다!

Comment thread coin-change/ICE0208.java
public int coinChange(int[] coins, int amount) {
// 필요한 동전의 최대 개수는 amount개이므로,
// amount + 1은 만들 수 없는 상태를 나타내기에 충분하다.
int impossible = amount + 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.

이름이 강렬하네요

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.

요거 재귀로도 풀어보셔도 좋을 거 같습니다.

@ICE0208
ICE0208 merged commit bc97a50 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