Run time error in this code, see in collaborate mode

can u please help?? it is giving run time error in this code for input of size 8 and more
ex -
8
1 2 6 2 7 1 3 2