Wa+ Tle . Please check my code
@avikaldarolia7 you forgot to take the modulo at every step.
Also in recursive case, you two choices either to take the denomination or to skip it.
So, if you taken the denomination then also for next recursive call there is chance that it is chance that it is taken again. (because of infinite supply of coins).
If it still gives TLE then try Bottom Up DP(iterative approach).
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.