Description:
Count the number of prime numbers less than a non-negative number, n.
1 class Solution { 2 public: 3 int countPrimes(int n) { 4 vectornum(n-1,true); 5 num[0]=false; 6 int res=0; 7 int limit=sqrt(n); 8 9 for(int i=2;i<=limit;i++)10 {11 if(num[i-1])12 {13 for(int j=i*i;j