class Solution { public int countPrimes(int n) { boolean [] notPrime = new boolean[n+1]; int count = 0; for(int i=2; i