1 / 7
Nov 2018

Hi I am trying to complement dijkstra and using various test cases it seems right. Can anyone point out to me why it is giving WA? Is it an edge case?

[edit] I took out the code bc I got answer accepted. If you are interested in my solution feel free to ask me :slight_smile:

Take another look at those lines.

Any chance you can be more specific? To me this looks right :confused:

What is held in first and what is in second? Why would you assign one to the other?

first is the node number, second is the cost to that node. In that line I am setting the distance in the dist array using the node number and getting the cost from second.

omg I just found the problem. I forgot to add an endline if the answer wasn’t no :man_facepalming: