Pregunta de entrevista de McDonald's

Challenging problem that you solved