Count the Primes
How many primes are there in the range [1, N]?
Input: one integer N.
Output: the number of primes ≤ N.
Constraints:
- 1 ≤ N ≤ 106
Sample Tests
Input 1
10
Output 1
4
Input 2
1
Output 2
0
Discussion (opens after you solve — no spoilers before)
No comments yet.