04.08 · Problem
Coin Change: Fewest Coins
You have an unlimited number of coins of each value. Return the fewest coins that add up to exactly amount, or −1 if it can’t be done.
Examples
Example 1
Input: coins = [1, 2, 5], amount = 11
Output: 3
5 + 5 + 1.
solulu Pro
Continue this problem with Pro
Inside: step-by-step hints · 12 hidden tests · reference solutions · code editor.
Lifetime ₹1,999 ₹999 · Launch offer
Item 34 of 44 · updated 2026-10-13