Please help me with finding the Nth prime number when N is very large(10^12).
Nth Prime Number
I am also facing time limit exceeded issue
Can you Provide the Qn link ?
Actually constraints in this question is just <= 500000. SO you can find nth prime for this constraint using Sieve very easily .
Check this out, “Sieve of Eratosthenes”! Best algorithm to find Nth Prime Number 