Pergunta de entrevista da empresa Emergent Software

Solve a small problem in Python