avatar Bite 277. Number of coin changes

Pat is going to apply for a cashier job in the local supermarket.

His friends suggested to brush up his basic math skills, particularly how to make changes in different coin denominations.

Can you help him leveraging your programming skills?

Given a list of positive integers representing coins denominations, and a positivie integer N representing the requested change of money, come up with a function that calculates the number of ways to make the change using the given coins. 

You can assume there is an unlimited amount of coins in each denominations.

## Example:

n = 5 and coins = [1, 2, 5, 10]

>> make_change(n, coins)
4 (five "1", 1+1+1+2, 1+2+2, and one "5")

>>> make_change(6, coins)
5
Login and get coding
go back Advanced level
Bitecoin 4X

62 out of 66 users completed this Bite.
Will you be Pythonista #63 to crack this Bite?
Resolution time: ~61 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 8.75 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help