Coin change problem

explain ans=min(ans, subprob+1)
why subprob +1?

+1 means adding 1 coin to the already calculated subproblem.
You are using a coin then only you are reaching to that subproblem so we add 1

1 Like