Pregunta de entrevista de Arm

A simple algorithm problem. Dived into assembly level.