Turing interview question

Coding Test: Frog and Fly distance Problem