algorithm notes: leetcode#204 count primes