Dsa
Greedy
Warm-up
Coin Change
You have an infinite supply of coins of different denominations. Given an amount, find the minimum number of coins needed to make that amount. Input consists of a line containing the number of denominations followed by a line with the denominations and a final line with the target amount. Output the minimum number of coins required.
Example:
Input:
3
1 5 10
23
Output:
3
Key concepts
greedydynamic programmingarray
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now