Nixa.io interview question

Algorithms