Given an integer n, return the number of prime numbers that are strictly less than n.
# Sieve of EratosthenesclassSolution:defcountPrimes(self,n:int)->int:ifn<2:return0sieve=[1]*nsieve[0],sieve[1]=0,0res=0foriinrange(2,n):ifsieve[i]==1:res+=1forjinrange(i+i,n,i):sieve[j]=0returnres