Exchange_Coins__


it is failing for one of the test case.please suggest the changes in my code.

Hi @rajukumarbhui
For large value of n the value of q1,q2,q3 and dp[n] goes out of limit of int. So just replace int by long then it will pass all the test cases.

Here is your corrected code :

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.