You will be given:
- an amount of money
- an array of coin denominations
- you have access to an unlimited number of each coin denomination
For example, there are 3 ways to give change for 4 if you have coins with denomination 1 and 2:
1+1+1+1
1+1+2
2+2
Don't count coins in a different order more than once:
1+1+2 == 2+1+1
Your function should take an amount to change and an array of unique denominations for the coins:
computeChange(4, [1,2]) // => 3
computeChange(10, [5,2,3]) // => 4
computeChange(11, [5,7]) // => 0