Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 204. Count Primes
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source