Exchanging Coins

https://ide.codingblocks.com/s/244533 I am getting run error here

Constraints
0 <= n <= 1000000000.
your code gives Exception in thread “main” java.lang.OutOfMemoryError: Java heap space.
Use HashMap instead of array.
HashMap<Integer, Long> map = new HashMap<Integer, Long>();


You can see this

I got it now, Thank you so much

Please mark your doubts as resolved in your course’s. and please rate your experience here