Start from 0 and Greedily (Shortest) Reach Everywhere Possible :) MST
Code
# Code
```cpp []
class Solution {
public:
    int minMaxWeight(int n, vector<vector<int>>& edges, int threshold) {
        vector<vector<pair<int, int>>> adjList(n, vector<pair<int, int>>());
        for(int i=0; i<edges.size(); i++) adjList[edges[i][1]].push_back(make_pair(edges[i][0], edges[i][2]));
        vector<int> dist(n, -1);
        priority_queue<pair<int, int>, vector<pair<int, int>>, greater<>> pq;
        pq.push({0, 0});
        while(!pq.empty()){
            auto [weight, node] = pq.top();
            pq.pop();
            if(dist[node] != -1) continue;
            dist[node] = weight;
            for(auto nghb: adjList[node]){
                if(dist[nghb.first] == -1){
                    pq.push({nghb.second, nghb.first});
                }
            }
        }
        int maxVal = INT_MIN;
        for(int i=1; i<n; i++){
            if(dist[i] == -1) return -1;
            maxVal = max(maxVal, dist[i]);
        }
        return maxVal;
    }
};
```
['C++']