Elementum Interview Question

Typical coding interview puzzles.