CODE HELP NEEDED ASAP

would you tell me how do i proceed in the double loop?

@sshreya2912
Initiall the ways[i] = INF, and ways[0] = 0;
now you do ways[i] = min(ways[i],ways[i-coins[j]]+1);

in the main function(of your code) n and t are exchanged, is that right? if yes explain 2)also it is starting from 0 till n-1(in ways function) we got to find ways[n] 3) would ways[15] be 3 and not 4, because according to me it should be 4

There are n-1 coins and we have to calculate min coins to make t.
Ways[15] would be two 7rs coins and one 1 rs coin.

number of ways to make 15 and not number of coins to make 15

Oh okay, i misunderstood the question, wait letme correct it.

please check now.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.