Given an integer M. return all prime numbers smaller than M.
Give a algorithm as good as you can. Need to consider time and space complexity.
Sieve of Eratosthenes is good.