The lead game

,

What is wrong in my solution…it is not accepting it?

LINK:CodeChef: Practical coding for everyone

its taking n+1 inputs for your test case…if u entered 5 as your test case it will take 5+1=6 inputs for your program…
try using n-1 in the two for loops