Pregunta de entrevista de Hopper

Simplified version of a problem that Hopper had to solve