Wrong output of the problem

int min_coins(int coins[], int t,int n,int dp[])
return 0;

    return dp[n];

int ans = INT_MAX;

for(int i = 0;i<t;i++){
        int sub = min_coins(coins,t,n-coins[i],dp);
        ans = min(ans,sub+1);
dp[n] = ans;
return dp[n];


The above code gives wrong output on geeks for geeks.
But I have done exactly what is taught.
Please look at it

@shreyaanand2908 please share the code using cb ide. and also send the question link.

This is the ques link - https://practice.geeksforgeeks.org/problems/number-of-coins/0

I am not able to copy my entire code on the cb ide, so I cant share it. What else can I do to share my entire code?


copy paste here save and share the link

The paste functionality of the ide does not work!
This is what I am saying

@shreyaanand2908 open this link on computer copy paste then file save copy link and paste
(on mobile its not possible)

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.