Pregunta de entrevista de Emergent Software

Solve a small problem in Python