Infosys interview question

Shortest path b/w two nodes