dsa · easy
Count Primes
GreyOrangeMathFoundation
Return the number of primes **strictly less than** n (sieve).
Arguments
n— count primes strictly less than this integer
**Example:** n=10 → 4 (2,3,5,7).
Constraints
0 <= n <= 5000 Hidden tests include near-max size for this bound; a slower-than-intended solution TLEs.
Examples
Example 1
Input: 10 Expected: 4
Example 2
Input: 0 Expected: 0