What's wrong in my code of dijkstras challenge

hi @Rishabhsharm, these are the errors in your code :-

  1. 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

  2. Graph g; should be declared inside while t-- as for every test case you need to make a new graph

  3. For unreachable nodes, print -1.

here i have corrected your code :

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved in case you got the answer