Why i got wa in 14 feb dcb i tried the code please correct my code

You have taken an array of sixe at max " [10000] " size whereas the question says the max value of n can be 10^6.

Also whenever You are initialising your code with such a huge value make sure you have assigned your array in the global space. Not inside int main.

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.