Stuart interview question

Solve one kata on codewars (quick and moderate difficulty)