How can you know if you solved it in optimal time?


#1

I solved it in sqrt(n) * number of primes between 1 to N (which is O(n / ln(n)). is it the best time possible?


#2

see the tutorial video best algo for finding prime number.