Prateek Loves Candy Problem

It is giving TLE for test case 5. Can you please tell what is wrong in my code. I have applied sieve of eratosthenes

increase array size 1000007
still u`ll encounter a tle in one case
have a look at the below code

1 Like

Now it’s working I created new array and stored all primes into it.Thank you so much for helping. :slightly_smiling_face:

1 Like