Why two test case has tle

Hi @kailash_01
I have seen your code, it is showing run error for 2 cases because as you can see that 1<=n<=5000000 so the nth prime number could be even greater then 5000000. Like for n=10 we get prime no. as 29, so you can see that for large value of n prime number could be greater than 5000000. In order to correct your code all you need to do is replace all 5000000 by 100000000.

Here is your corrected code :

If your doubt is clear then mark it as resolved.