πŸ’‘ Deepak and Primes

1 test case is not working

Hello Sulbh,
In the given question value of n can be 5000000 and 5000000th prime number is 86,028,121 which is really huge number.
you were not going till 86,028,121 number while preparing your sieve therefore one testcase was not working.
here is your working code https://ide.codingblocks.com/s/171464

I have made p array global because it’s size is large and we can not declare large size array inside any function.
I hope this will clear your doubt.
regards
Aman Yadav