Help with COINS!

Unable to figure out errors. Link to my solution is
https://www.codechef.com/submit/COINS
Please HELP!!!

please post link to your solution

1 Like

https://www.codechef.com/submit/COINS
Here is the link to my solution.

not able to view your solution if you could just paste it on some other platform and send link then

https://www.codechef.com/viewsolution/33361970

You are using a global map and hence for every new test case map is not empty and it uses already stored values.Correct this and i would suggest use array. Also take input this way
while(cin>>n)
{
// Try Yourself first
}
solution- https://www.codechef.com/viewsolution/33362614

Thanks !:slightly_smiling_face: