💡 Dijkstra's Algorithm - Doubt


why is this code failing the test cases ? the output seems
to be correct .