dsa · easy

Count Primes

GreyOrangeMathFoundation

Return the number of primes **strictly less than** n (sieve).

Arguments

**Example:** n=104 (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

Open in the Dojo editor