Can Someone tell me the error for this M-Code problem

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

help me ?

increase array size to n+1.

I tried fixing the error but got tle can anyone explain me the logic behind this problem