Given an integer n, return the number of prime numbers strictly less than n. This is the standard sieve-of-Eratosthenes counting problem and is the canonical prime sieve question.
n = upper bound
number of primes strictly less than n
Example 1:
Input:
n = 10
Output:
4
Explanation:
Primes less than 10 are 2, 3, 5, and 7.
Example 2:
Input:
n = 0
Output:
0
Explanation:
There are no primes below 0.