for local ide I am getting the correct answer but run error in this online ide
Why am i getting run error in 2nd and third case
hey @ashutosh2 Your code is not giving any error it is giving TLE that is Time limit exceeded.Since your code is not efficient for bigger testcases you have to use efficient approach for this question which is SOE(sieve of eratosthenes).
@ashutosh2 your code is giving Run error because your array size is is not fitted for the case when no. to be checked is 1000000.
So increase your array size.
Still the same error can you provide the changed code
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.