Showing run time error when submitting

@aryaman.kumar26 as per given constraints array size can be upto 10^5 but you have taken array of size 10^3 hence it is showing you run time error,take your array size as 10^5 it will work fine.

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.