Leetcode 204. Count Primes
Count how many prime numbers are strictly less than a given integer n. The challenge is to generate primes efficiently (e.g., Sieve of Eratosthenes) to handle n up to about 5×10^6 within O(n log log n) time and O(n) space.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.