Algorithms

Coin change

Finding the fewest coins, each type usable many times, that add up exactly to an amount, or counting how many ways it can be made.

Example

With coins of 1, 2 and 5, the amount 11 is made with 3 coins: 5 + 5 + 1.

Test yourself: Coin change

Unbounded knapsack and coins

With coins of 1, 2 and 5, the amount 11 is made with at least ___ coins.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.