Given an integer n, return the number of prime numbers that are strictly less than n.
Sieve of Eratosthenes: mark multiples of each prime as composite.
- Create boolean isComposite[] of size n.
- For each i from 2 to sqrt(n): if not composite, mark all multiples i*i, i*i+i, ... as composite.
- Count non-composite numbers.
- Time Complexity: O(N log log N)
- Space Complexity: O(N)