Test cases are not pasing

@lukharshiv,
Precompute the prime numbers. Before starting with the test cases. https://ide.codingblocks.com/s/259480

Don’t use <=n in the for loops. This is giving arrayindex out of bounds error. Since the test cases are large. You will get a TLE in 1 test case. To counter that, you can store the prime numbers in an array.
Eg.
ans[0] = 0
ans[1] = 2
ans[2] = 3
ans[3] = 5
and so on. Hence if count = 5, ans[count] will give us the required prime number.
https://ide.codingblocks.com/s/259483 approach where prime numbers are stored in an array.
We are storing the ith prime number in ans[ ] array. When we find a prime number we increment k and store it in the next index.

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.