Can someone help me find out the error>

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

1 Like

Increase the size of the array by 10 or 20 and then check.You are considering 1 based indexing.if the value is 1000 your array will go out of memory.