Question link : https://online.codingblocks.com/app/player/213153/content/213766/4702/code-challenge
My Solution link : https://ide.codingblocks.com/s/652864
How optimize code further ?
Question link : https://online.codingblocks.com/app/player/213153/content/213766/4702/code-challenge
My Solution link : https://ide.codingblocks.com/s/652864
How optimize code further ?
Implemented SOE, TLE in test case 0, what’s missing ?
Hey @mail2aqibahmed_23714997a14745bb
Main logic behind the question is that you need to find the nth prime number starting from 2. Any one can implement this logic “Not a big Deal” for anyone, but wait a min there’s more to it.
Many of you are getting time limit exceed right ? Even if you are using SOE (Sieve of Eratosthenes) for finding the prime numbers.
Have u see the constraint on number of test cases, It’s quite large because for every test case you are going to find the prime numbers upto that number and at last return the last prime number found, this will cause the TLE for big test cases.
That’s how we need not to find the prime number for every test case.
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.