Amazon Interview Question

Nothing too complicated