Pregunta de entrevista de Alpaca

Fairly straight-forward coding question to answer.