What is wrong in my solution…it is not accepting it?
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
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