Amazon interview question

Find all the prime numbers until n

Interview Answer

Anonymous

26 Jan 2023

brute force until sqrt n and then optimize to use sieve of Eratosthenes