Your quirky boss collects rare, old coins...
They found out you're a programmer and asked you to solve something they've been wondering for a long time.
Write a function that, given:
- an amount of money
- a list of coin denominations computes the number of ways to make the amount of money with coins of the available denominations.
Example: for amount = 4 (4¢)
and denominations = [1,2,3] (1¢, 2¢ and 3¢)
, your program would output 44—the number of ways to make 44¢ with those denominations:
- 1¢, 1¢, 1¢, 1¢
- 1¢, 1¢, 2¢
- 1¢, 3¢
- 2¢, 2¢