Deepak and Primes

Please tell why it is is showing run time error on 2 test-cases?

we cannot use sieve of eratosthenes in the given constraint range.since we can’t make a array of size greater than 10^7.

So how to solve it then?

hey dhruv, i have check all the array limits precisely for this question please use your MAX_SIZE as (87*10^6).it will work fine and let me know if it works.

hey @dhruvgupta1498 if you are still facing any problem please ask else please mark this doubt as resolved, thankyou.

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.