Cognizant interview question

Was asked to solve using dijkstra algorithm