Pregunta de entrevista de Lucid Software

Hacker rank programming exercise (1 question).