# 计数质数
统计所有小于非负整数 n 的质数的数量。
示例 1:
输入:n = 10
输出:4
解释:小于 10 的质数一共有 4 个, 它们是 2, 3, 5, 7 。
示例 2:
输入:n = 0
输出:0
示例 3:
输入:n = 1
输出:0
提示:
## template
```python
class Solution:
def countPrimes(self, n: int) -> int:
is_prime = [1] * n
count = 0
for i in range(2, n):
if is_prime[i]:
count += 1
for j in range(i * i, n, i):
is_prime[j] = 0
return count
```
## 答案
```python
```
## 选项
### A
```python
```
### B
```python
```
### C
```python
```