Dijkstra's BFS C++ SOLUTION
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int networkDelayTime(vector<vector<int>>& times, int n, int k) {\n        vector<vector<pair<int,int>>> graph(n + 1);\n        for(auto& x : times){\n            graph[x[0]].push_back({x[1], x[2]}); \n        }\n        vector<int> dist(n + 1, INT_MAX);\n        priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> pq;\n        dist[k] = 0;\n        pq.push({0, k});\n        while(!pq.empty()){\n            int u = pq.top().second;\n            int d = pq.top().first;\n            pq.pop();\n            if(d > dist[u]) continue;\n            for(auto& newnode : graph[u]){\n                int v = newnode.first;\n                int weight = newnode.second;\n                if(dist[u] + weight < dist[v]){\n                    dist[v] = dist[u] + weight;\n                    pq.push({dist[v], v});\n                }\n            }\n        }\n        int ans = -1;\n        for(int i = 1; i <= n; i++){\n            if(dist[i] == INT_MAX) return -1;\n            ans = max(ans, dist[i]);\n        }\n        return ans; \n    }\n};\n```
['C++']