C++ Binary Search on Answer :)
Code

# Code
```cpp []
class Solution {
public:

    bool canSolve(vector<pair<int,int>> V[], int n, int mid){
        vector<bool> visited(n, false);
        visited[0] = true;
        queue<int> Q;
        Q.push(0);
        while(!Q.empty()){
            int node = Q.front();
            Q.pop();

            for(auto child: V[node]){
                int u = child.first;
                int wt = child.second;
                if(!visited[u] && wt <= mid){
                    visited[u] = true;
                    Q.push(u);
                }
            }
        }

        for(int i=0; i<n; i++) 
            if(!visited[i]) 
                return false;

        return true;
    }

    int minMaxWeight(int n, vector<vector<int>>& edges, int threshold) {
        int start=0, end=1e6;
        vector<pair<int,int>> V[n];
        for(auto x: edges){
            // reversed the graph (as I want that 0 can reach all nodes instead all nodes reaching 0)
            V[x[1]].push_back({x[0], x[2]});
        }

        while(start < end){
            if(end-start == 1) break;
            int mid = start + (end-start)/2;

            if(canSolve(V, n, mid)){
                end = mid;
            } else{
                start = mid;
            }
        }

        if(canSolve(V, n, start)) return start;
        if(canSolve(V, n, end)) return end;

        return -1;
    }
};
```
['Binary Search', 'C++']