Deepak and primes


why this code failed for last test case even after increasing size of array. I had made the array size to 5000000
but it fails

hello @mohitshendre2609

ur sieve size should be greater than the value of 5000 000th prime number, so check 5000 000th prime number and declare ur sieve size just greater than that.
rest of the logic will remain same.

refer this->