Pregunta de entrevista de RELEX Solutions

Solve a simple algorithm question, and explain your steps.