Skip to content

[hi-rachel] Week 04 Solutions #1340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 27, 2025
Merged

[hi-rachel] Week 04 Solutions #1340

merged 6 commits into from
Apr 27, 2025

Conversation

hi-rachel
Copy link
Contributor

@hi-rachel hi-rachel commented Apr 20, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

Comment on lines +29 to +37
class Solution:
def coinChange(self, coins: List[int], amount: int) -> int:
dp = [0] + [amount + 1] * amount

for coin in coins:
for i in range(coin, amount + 1):
dp[i] = min(dp[i], dp[i - coin] + 1)

return dp[amount] if dp[amount] < amount + 1 else -1
Copy link
Contributor

Choose a reason for hiding this comment

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

@hi-rachel 님 안녕하세요. 이번 주도 고생하셨습니다. 저는 문제를 풀 때 dp로 접근하는 것을 어려워하는 편이라서, 특히 dp 풀이법을 인상깊게 봤습니다. 다음 주도 파이팅하세요 💪

Copy link
Contributor

Choose a reason for hiding this comment

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

그리고 전체적으로 풀이가 깔끔해서 나중에 공부할 때도 참고가 될 것 같습니다. 감사합니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hi-rachel 님 안녕하세요. 이번 주도 고생하셨습니다. 저는 문제를 풀 때 dp로 접근하는 것을 어려워하는 편이라서, 특히 dp 풀이법을 인상깊게 봤습니다. 다음 주도 파이팅하세요 💪

@KwonNayeon 님 안녕하세요 :) 저만 dp가 어려운게 아니였군여ㅜㅜ 저도 dp 문제는 이해 안가는 문제들이 많아서 힘들었는데 다행히 이 문제는 알고달레의 설명을 보고 이해했습니다. 저도 못풀어서 알고달레 풀이를 참고했는데 자세한 풀이를 원하실 때 추천드립니다. 감사합니다~

https://www.algodale.com/problems/coin-change/

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 dp는 간단한 문제 아니면 응용하기 너무 어렵더라구요...😂 역시 알고달레 👍 정말 감사합니다!

Copy link
Contributor Author

@hi-rachel hi-rachel Apr 27, 2025

Choose a reason for hiding this comment

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

저도 dp는 간단한 문제 아니면 응용하기 너무 어렵더라구요...😂 역시 알고달레 👍 정말 감사합니다!

@KwonNayeon dp + 재귀 + 백트래킹 넘나 어려워요.. 이번 스터디 끝날 때쯤에는 사고가 넓어져있길! 같이 파이팅합시다! 감사합니다.

@hi-rachel hi-rachel moved this from Solving to In Review in 리트코드 스터디 4기 Apr 27, 2025
@hi-rachel hi-rachel merged commit 4aee128 into DaleStudy:main Apr 27, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 4기 Apr 27, 2025
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.

2 participants