MORSE Corp Interview Question

How would you make this solution more efficient?