Apple Interview Question

Code optimization of an existing code printed on a paper