I think the following solution is quite efficient still I get time limit exceeded.

Any chances of relaxing the TLE or any suggestions on how to reduce the running time of my implementation?

```
def countPrimes(self, n):
if n < 2: return 0
sieve = [1] * (n-1)
ptr = 2
while ptr < len(sieve) - 1:
if sieve[ptr] == 0:
ptr = ptr + 1
continue
new_ptr = ptr + ptr
while new_ptr < len(sieve):
sieve[new_ptr] = 0
new_ptr = new_ptr + ptr
ptr += 1
return sum(sieve) - 2
```