I need to write a function that generates all of the ways that change for a an amount can be made. However, we are not using nickle, dimes, and quarters to make this change. We are using a set of inputted values.
For example, if my inputs are: X = [2 3 4] and Y = 32
My output should be:
16 0 014 0 110 0 3etc...,
showing all of the ways that I can make a sum of 32 with the coin values 2,3, and 4.
I've tried to use some sort of permutation to do this, and I've also tried using mod(x,y) in different fashions, and cannot seem to get the correct result.
Any insights? Thanks a lot folks!