Daily Archives: October 12, 2015


[leetcode] Count Primes

Count Primes Description: Count the number of prime numbers less than a non-negative number, n. Credits: Special thanks to @mithmatt for adding this problem and creating all test cases. A naive approach, check each i smaller than n that is prime or not. O(n^2), time limit exceeded. class Solution { […]