Prime visit unable to understand code

please explain the code for this problem I am unable to getting this

You have to count the number of prime numbers in a given range from a to b. For this purpose, you could first build a sieve with maximum length and then count the total number of primes in the range using the sieve array.

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.