Skip to content

[dolphinflow86] WEEK 05 Solutions#2762

Open
dolphinflow86 wants to merge 1 commit into
DaleStudy:mainfrom
dolphinflow86:main
Open

[dolphinflow86] WEEK 05 Solutions#2762
dolphinflow86 wants to merge 1 commit into
DaleStudy:mainfrom
dolphinflow86:main

Conversation

@dolphinflow86

@dolphinflow86 dolphinflow86 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

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, Two Pointers
  • 설명: 최소 가격을 추적하며 현재 가격과의 차이로 이익을 갱신하는 방식으로, 한 번의 순회로 최적 해를 구하는 그리디 패턴에 해당합니다. 또한 가격을 한 방향으로 스캔하며 최대 이익을 계산하므로 투 포인터의 간단한 변형으로 볼 수 있습니다.

📊 시간/공간 복잡도 분석

유저 분석 실제 분석 결과
Time O(N) O(n)
Space O(1) O(1)

피드백: 초기 최소 가격을 설정하고 가격이 오를 때마다 이익을 갱신하는 단일 순회 방식이다.

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

@dalestudy

dalestudy Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

📊 dolphinflow86 님의 학습 현황

이번 주 제출 문제

문제 난이도 유형 분석
best-time-to-buy-and-sell-stock Easy ✅ 의도한 유형

누적 학습 요약

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

문제 풀이 현황

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

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

🔢 API 사용량 (gpt-5-nano)
요청 입력 토큰 출력 토큰 합계 비용
1 325 53 378 $0.000037

@okyungjin

okyungjin commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@dolphinflow86 안녕하세요~ 상태 In Review로 설정되어 있는데 의도하신게 맞는지 확인 부탁드립니다!

@dolphinflow86

dolphinflow86 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@dolphinflow86 안녕하세요~ 상태 In Review로 설정되어 있는데 의도하신게 맞는지 확인 부탁드립니다!

안녕하세요! In Review로 된 것은 의도가 맞습니다. 예전에 스터디 가이드쪽에서 미리 PR을 올리고 리뷰를 길게 받으면서 가는게 좋다고 하신걸 본적이 있어서요. In Review로 바꾸는 것은 제가 잘못 봤을수도 있습니다 -> Solving으로 바꿔놓았습니다~

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

깔끔하게 잘 해결해 주셨네요!
best time to buy and sell stock, 즉 해당 문제는
뒤에 로마 숫자를 붙혀서 1, 2, 3, 4, 5 총 다섯종류가 있는데요
dp 연습하기에 정말 괜찮은 문제라고 생각해서
2번문제
II는 한번 풀어보시길 추천드려요!

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.

오! 네 문제 추천 감사합니다! 한번 풀어볼게요 👍

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

Labels

Projects

Status: Solving

Development

Successfully merging this pull request may close these issues.

3 participants