Pregunta de entrevista de Centific

Coding question but straight forward.