Skip to content

[yuseok89] WEEK 03 Solutions#2719

Open
yuseok89 wants to merge 24 commits into
DaleStudy:mainfrom
yuseok89:main
Open

[yuseok89] WEEK 03 Solutions#2719
yuseok89 wants to merge 24 commits into
DaleStudy:mainfrom
yuseok89:main

Conversation

@yuseok89

@yuseok89 yuseok89 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@dalestudy

dalestudy Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📊 yuseok89 님의 학습 현황

이번 주 제출 문제

문제 난이도 유형 분석
combination-sum Medium ✅ 의도한 유형
decode-ways Medium ✅ 의도한 유형
maximum-subarray Medium ✅ 의도한 유형
number-of-1-bits Easy ⚠️ 유형 불일치
valid-palindrome Easy ✅ 의도한 유형

누적 학습 요약

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

문제 풀이 현황

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

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

🔢 API 사용량 (gpt-5-nano)
요청 입력 토큰 출력 토큰 합계 비용
1 1,682 304 1,986 $0.000206
2 1,680 287 1,967 $0.000199
합계 3,362 591 3,953 $0.000405

@yuseok89 yuseok89 moved this from Solving to In Review in 리트코드 스터디 8기 Jul 7, 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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Backtracking, Depth-First Search, Greedy, Dynamic Programming
  • 설명: 코드는 후보들로 가능한 모든 조합을 재귀적으로 탐색하며 조건(target)에 맞는 조합을 찾는 Backtracking 방식이다. 깊이 우선 탐색으로 후보를 차례로 선택해 시간 복잡도와 공간 사용을 제어한다. 다만 각 후보의 중복 사용을 허용하지 않고 시작 인덱스를 올려 조합을 구성한다.

📊 시간/공간 복잡도 분석

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

피드백: 중복 제거 없이 각 후보를 순차적으로 탐색하고, 하나의 후보를 여러 번 사용할 수 있도록 다중 포함 루프를 두고 있다.

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

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

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 decode-ways/yuseok89.py

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, Binary Search
  • 설명: 코드는 문자열 인덱스에 따른 부분문제를 해결하는 재귀+메모이제이션 방식으로, 각 위치에서 한 글자 또는 두 글자로 숫자 해독 가능 여부를 확인해 부분해를 합산합니다. 이는 DP와 메모이제이션의 전형적인 패턴이며, 이 경우 두 글자 읽기 조건으로 상태를 분할하는 점이 핵심입니다.

📊 시간/공간 복잡도 분석

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

피드백: 앞서 계산한 값을 memo에 저장해 중복 계산을 피한다. 끝까지 순차적으로 탐색한다.

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

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

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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Greedy, Dynamic Programming
  • 설명: 최대 부분 배열 합 문제를 한 루프에서 현재 부분합을 최소 지점에서 다시 시작하는 방식으로 갱신하는 Greedy 접근이다. 부분합의 최댓값을 누적하고 필요시 현재 수로 초기화하는 DP적 사고도 포함된다.

📊 시간/공간 복잡도 분석

유저 분석 실제 분석 결과
Time O(N) O(n)
Space O(1) 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.

아주 개인적인 의견으로는

  1. for loop안의 if-else 부분도 max로 한줄로 깔끔하게 정리하면 보기 좋을것 같아요!
  2. sum과 ans를 nums[0]으로 설정하셨는데 for loop도 0번 index부터 시작하는건 중복 검사 같네요, 1번 index부터 검사하시는게 로직상 맞지 않을까 하는 생각이 듭니다.

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.

🏷️ 알고리즘 패턴 분석

  • 패턴: Bit Manipulation
  • 설명: 입력 정수를 이진수로 순회하며 각 자릿수를 확인하는 방식으로 1의 개수를 세는 비트 조작 기반 패턴입니다. 연산은 O(logN) 시간, O(1) 공간으로 작동합니다.

📊 시간/공간 복잡도 분석

유저 분석 실제 분석 결과
Time O(logN) O(n)
Space O(1) 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.

깔끔하게 잘 해결하신거 같아요!

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, Hash Map / Hash Set
  • 설명: 공백 없는 문자열 비교를 양 끝에서 한 칸씩 비교하는 투 포인터 방식으로 팰린드롬 여부를 확인합니다. 정규화로 문자 집합을 제거하고 대소문자 구분을 없앤 뒤 양 끝의 문자 비교를 반복합니다.

📊 시간/공간 복잡도 분석

유저 분석 실제 분석 결과
Time O(N) O(n)
Space O(1) 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.

해당 풀이는 Immutable 한 string을 하나 더 만들기 때문에 O(N)의 공간복잡도를 가질거에요!
설명
regex없이 two pointer로 접근해보시는것도 좋은 경험이 되실겁니다.

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

깔끔하게 잘 해결하신것 같습니다!

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.

해당 풀이는 Immutable 한 string을 하나 더 만들기 때문에 O(N)의 공간복잡도를 가질거에요!
설명
regex없이 two pointer로 접근해보시는것도 좋은 경험이 되실겁니다.

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.

아주 개인적인 의견으로는

  1. for loop안의 if-else 부분도 max로 한줄로 깔끔하게 정리하면 보기 좋을것 같아요!
  2. sum과 ans를 nums[0]으로 설정하셨는데 for loop도 0번 index부터 시작하는건 중복 검사 같네요, 1번 index부터 검사하시는게 로직상 맞지 않을까 하는 생각이 듭니다.

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.

다 좋으신데, 백트래킹 부분이 너무 복잡한거 같아요
별도의 함수로 제외하지 않고 구현하시면 훨씬 보기 좋게 될거 같아요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants