I did not understood the logic can someone help

Please explain me the concept of solving this problem i am unable to understand

hi @numanshaikh25,
this will help you to calculate things related to prime no in an optimized way, even you can pre-calculate and thus will help you in reducing time complexity.

You can read more from https://cp-algorithms.com/algebra/sieve-of-eratosthenes.html

anything specifically you wanna know more?

and what is LL in the for loop initialization

@numanshaikh25, it is long long int

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.