medium Dynamic Programming
Coin Change
Given coin denominations `coins` and a target `amount`, return the fewest coins that sum to the amount, or -1 if it is impossible. Example: ([1, 2, 5], 11) → 3 (5 + 5 + 1); ([2], 3) → -1.
runs in your browser