Coin change permutation

why dont we make a call to number which is lesser than the previousl called number anfd only make to the numbers more or equal to previous call

Hi Naman
That is an interesting observation. However it is the same as the method discussed in the video, you are just saying it in different way/constraint.
The array of denominations have been kept in an increasing order(2,3,5,6). So making the constraint of keeping index more than last or making it to numbers more or equal to previous call provide the same functionality.
However your method is more stronger as it is generic and does not need the array to be sorted.

1 Like

Also since it is combinations not permutations, your method will always give answer in a decreasing order (like 5,3,2 )

1 Like