C++ Dijkstra
Solved live on stream.  Link in profile\n\n\nclass Solution {\npublic:\n    int networkDelayTime(vector<vector<int>>& times, int n, int k) {\n        using pii 
Solved live on stream.  Link in profile\n\n```\nclass Solution {\npublic:\n    int networkDelayTime(vector<vector<int>>& times, int n, int k) {\n        using pii = pair<int,int>;\n        vector<vector<pii>> adjList(n);\n        priority_queue<pii, vector<pii>, greater<pii>> pq;\n        for(auto& time : times) {\n            int src = time[0]-1;\n            int dst = time[1]-1;\n            int wt = time[2];\n            adjList[src].push_back({wt, dst});\n        }\n        vector<int> dists(n, INT_MAX);\n        dists[k-1] = 0;\n        pq.push({0, k-1});\n        \n        while(!pq.empty()) {\n            auto [wt, src] = pq.top();\n            pq.pop();\n            if(dists[src] < wt) continue;\n            auto& children = adjList[src];\n            for(auto& [childWt, dst] : children) {\n                int newWt = wt + childWt;\n                if(newWt < dists[dst]) {\n                    dists[dst] = newWt;\n                    pq.push({newWt, dst});\n                }\n            }\n        }\n        int ans = 0;\n        for(int x : dists) {\n            if(x == INT_MAX) return -1;\n            ans = max(ans, x);\n        }\n        \n        return ans;\n    }\n};\n```
[]