Pergunta de entrevista da empresa Cognizant

Was asked to solve using dijkstra algorithm