I started an algorithm course in C two months ago, for the last weeks I've been trying to solve this problem , i ran out of time but I cannot find an acceptable solution. Basically It's a coin change problem, Given a sum (S) I need to find (and print) the combination that uses the least amount of coins, I can only use coins that are available. For example: INPUT: S=10 Coins={2,3,4,5} Supply={1,3,1,0} OUTPUT: 3 3 4
I've been able to solve the normal coin change problem but I can't seem to find a way to manage supplies so that the program doesn't use a coin when its supply=0.