Arm Interview Question

A simple algorithm problem. Dived into assembly level.