Amazon Interview Question

Data structures/Algorithms question in language of choice