Minimum Weight Path In A Directed Graph Hackerrank Solution, The idea is to maintain distance using an array dist [] from the given source to all vertices.