Amazon Interview Question

just needed to finish the class