Amazon Interview Question

Why was the answer the most efficient