Duolingo interview question

Standard coding exercises--explain your thoughts as you go and solve the problem