Millennium Interview Question

Formal maths & puzzles + hackerrank.