Easy classic DIJKSTRA C++ | easy to understand :)
Intuition\nshortest path / distance nikalna ho jaha bhi sidha dijkstra lagado..\nwe get the distance from node k to every node sabse kam length ka.\nphir check 
# Intuition\nshortest path / distance nikalna ho jaha bhi sidha dijkstra lagado..\nwe get the distance from node k to every node sabse kam length ka.\nphir check karlo dist m konsa sabse dur hai..\nutna hi time lagega max spread hone m..\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n\nsimilar to the classic ques in tree\ninfection problem on geegsforgeeks\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: Elog V due to priority queue use\n\nhere we cant use normal queue becuase weights are different matlab distance alag hai sab jagah ki to hame khudse min chhaiye har iteration me\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: space of adjacency list and distance vector\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\n        // adjacency list banado mast, use classic pair method\n        vector<pair<int,int>> adj[n+1]; \n        // <!-- min heap banadia ek jo min distance dega bar bar priority queue m  -->\n        priority_queue<pair<int,int> , vector<pair<int,int>> , greater <pair<int,int>>> pq;\n\n        // <!-- directed hai to ek sided list define kardi  -->\n\n        for( auto it : times){\n            adj[it[0]].push_back({it[1] , it[2]});\n        }\n\n        // <!-- sabki distance ko k node se initially infinite mark krdia -->\n        vector<int> dist(n+1, 1e9);\n\n        // <!-- node k ki node k se distance to 0 hi hogi  -->\n        dist[k] =0;\n        pq.push({0,k});\n\n        // <!-- iteration traversal BFS starts -->\n\n        while(!pq.empty()){\n            auto it = pq.top();\n            pq.pop();\n            int dis = it.first;\n            int node = it.second;\n\n            // <!-- ab har node ko pura check karna hai ek edge at a time -->\n\n            for( auto it : adj[node]){\n                int adjnode = it.first;\n                int wt = it.second;\n\n                // <!-- agar distance kam ayi kisi tarah to us node ki dist update kardo kam wali -->\n\n                if(dist[adjnode] > dis +wt){\n                    dist[adjnode] = wt+dis;\n                    pq.push({dis+wt, adjnode});\n                }\n            }\n        }\n\n        // <!-- max distance node k se is the weight taken to spread in whole graph -->\n        int ans = 0; \n        for ( int i=1;i<dist.size(); i++){\n            ans = max(ans, dist[i]);\n        }\n\n        // <!-- agar visit hi nahi hua to -1 return karo  -->\n        \n        if( ans == 1e9) return -1;\n        return ans;\n\n\n\n\n        \n    }\n};\n```
['Breadth-First Search', 'Heap (Priority Queue)', 'C++']