Amazon interview question

Data structure and algorithms, Graphs and arrays