Run error in Exchanging Coins

https://hack.codingblocks.com/contests/c/452/721
https://ide.codingblocks.com/#/s/15802

It is showing run time error for n=10^9.
I have used maps instead an array, and modified your code.
https://ide.codingblocks.com/#/s/15817

2 Likes