Amazon Interview Question

See details in previous description