sir after submitting the solution one of my three test cases is wrong and the compiler msg is “TLE”,what does it mean ,plz explain the compilers msg
Prime Visit ,Challenges Arrays
You are supposed to use the prime seive optimisation technique. Also make sure that you call the primeseive function that you will make before the test cases only to prevent TLE.
Precompute the prime numbers using sieve technique.
In the sieve technique where you create a boolean array of 1000005 size.
And start from the first prime number i.e. 2. Take its square(4) and increment it by the number you took (i.e. 4,6,8,10 and so on). Mark all these as false since they cannot be primes.
Now take the next unmarked number, 3. And mark 9,12,15 and so as false. Similarly do it for 4. 16,20,24 and so on as false.
When you finish the loop, count the number of primes within the range.
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.
@sameeksha
It seems you have reopened this doubt thread. Kindly let me know any further queries that you have so I can help you out regarding this doubt.
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.