Macy's Interview Question

pretty basic