Deutsche Telekom Interview Question

Sieve of eratosthenes implementation. MEX (minimum excluded number) problem.