Pregunta de entrevista de Devexperts

It was a coding task