Amazon interview question

Data structures/Algorithms question in language of choice