Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Coin Change 2
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given coin denominations and an amount, find the number of combinations to make that amount.
Sample Input:
[1,2,5], 5
Sample Output:
4
Hints
Hint 1
Use dynamic programming
Hint 2
DP[i] = sum of DP[i - coin] for all coins
Hint 3
Process coins one by one to avoid counting permutations
Code Editor
Reset
Run
Save
Loading...