Turing interview question

solving a live coding challenge