Gettingwrong answer of Deepak and primes challange

@Jun18APP0112 your logic is wrong somehow it is giving wrong answer for many queries.
for this question you should use Sieve of Eratosthenes to store prime numbers.

but this approach is faster. can you please tell for what case it is giving wrong answer

@Jun18APP0112 take input as 10.

I have tried by this also---- https://ide.codingblocks.com/s/183510

showing timelimit exceed

instead of calling prime function every time make an array and store every prime number in it and just print arr[n-1] as your answer

@Jun18APP0112 view this for help (https://ide.codingblocks.com/s/183513) .

this code is showing run time error for n=5000000

take MAX_SIZE as 10^8 it will work fine.

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.