Login and get codingPat 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

Metrics »

63 out of 67 users completed this Bite.

Will you be the 64th person to crack this Bite?

Resolution time: ~68 min. (avg. submissions of 5-240 min.)

Our community rates this Bite 8.75 on a 1-10 difficulty scale.

» Up for a challenge? 💪

Ask for Help