1.Count Prime
Count the number of prime numbers less than a non-negative number, n
Solution I (Iterating till √n)
Time complexity: O(√n)
Prime Sieve Method (Sieve of Eratosthenes)
Time Complexity : O(n*log(log(n))) Space Complexity : O(n)
Last updated