Turing Interview Question

solving a live coding challenge