my code is showing timelimit error in the test case no.3
Prime Visits doubt
still the code show TLE.
@Ajitverma1503
Since the constraints are high , you should go for an optimised approach to compute prime numbers. Try using Sieve Technique which is discussed in the Number Theory Section in your course . It is an optimised technique to precompute prime numbers and will help you resolve the TLE.
hey @Ajitverma1503, as constraints are high you should use prime seive to find prime number as it takes less time.
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.
@Ajitverma1503
You should call primeseive for only single time and use the same result array for each test case. This avoids calling it for every testcase.
Hope it helps
Mark the doubt if resolved
thank you