Firstly take an array of Size n with all the values as True.

Next make 0,1 as False and then from 4-n make all even number False.

Now check from 3 to N if there is an odd multiple of i make it false.

'''

class Solution(object):

def countPrimes(self, n):

"""

:type n: int

:rtype: int

"""

isPrimes = [True]*n

isPrimes[0:2] = [False]*2
isPrimes[4:n:2] = [False] len(isPrimes[4:n:2])
for i in range(3,n,2):
if isPrimes[i] == True:
isPrimes[ii:n:i*2] = [False]

*len(isPrimes[i*i:n:i])

```
return sum(isPrimes)
```

'''