Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given an integer n, return the number of prime numbers that are strictly less than n.
 
Please complete the following python code precisely:
```python
class Solution:
    def countPrimes(self, n: int) -> int:
```