Chef recepie

https://www.codechef.com/viewsolution/33327423
what is the problem with this solution

cnt can be max upto 1000. So, max value of index of hash can go to 1000. But your array is declared of size 1000 only. So, it can reach upto 999.
eg- n=1000
1 1 1…(1000 times)