Two test cases are showing run error

i doesn’t have any clue why run error is shown in two test cases my code is here https://ide.codingblocks.com/s/141745

Hi ritik
Please read constraints properly N<10^5, your array size is 10005, it goes out of bounds.
Hope it helps:)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.