hii, this is my code : https://ide.codingblocks.com/s/169780 .
in this i have made an optimised function for detecting a prime number and counted the number of prime numbers between a and b using 1 for loop and it is showing TLE.
I am not able to understand the solution to this problem as they have just given the code and not explained it
Prime Visits solution
@alankrit.agr99 You have to use Sieve of Eratosthenes for primes in this problem. The test cases are large and so without this it will give TLE. Lecture video of Sieve of Eratosthenes is there in the Number Theory section of your course. Please refer that first and then try to solve this problem using that concept.