What's wrong in my code of dijkstras challenge
hi @Rishabhsharm, these are the errors in your code :-
-
this is the output format as mentioned in the question
print a single line consisting N-1 space separated integers denoting the shortest distance of N-1 nodes other than from starting position S in increasing order of their labels.which you have not taken care of -
Graph g; should be declared inside while t-- as for every test case you need to make a new graph
-
For unreachable nodes, print -1.
here i have corrected your code :
In case of any doubt feel free to ask 
mark your doubt as resolved in case you got the answer