Amazon interview question

Ask to write code to find shortest path from a forest(2D Array Graph)