Arm interview question

Explain your solution to the coding problem and how it could be improved.