Simple BFS 
IntuitionStart with node 0 and find minimize the weight in the path to reach other nodes .Approachreversed the edges for smooth traversal
Maintained a queue of
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Start with node 0 and find minimize the weight in the path to reach other nodes .
# Approach
<!-- Describe your approach to solving the problem. -->
reversed the edges for smooth traversal 
Maintained a queue of  (node , max weight traversed to reach that node)
then traverse all the neighbour nodes 
update weight of the neighbour node min(neighbour node weight, max(edgeWeight, srcNodeWeight));
if neighbour weight decreases in this step then we need to consider this node and its neighbours again
hence push it into the queue

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(E) we will traverse each node at most once 
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(N) all nodes will be stored in the worst case scenario
# Code
```cpp []
class Solution {
public:
    int minMaxWeight(int n, vector<vector<int>>& edges, int threshold) {
        // maintain queue with node and curr min of max edge traversed in this path
        // update weight of the dst node min(dst node weight, max(edgeWeight, srcNodeWeight));
        // if dst node weight value changes then push 
        // else ignore
        // return the max of the all the weight of the nodes
        vector<vector<pair<int,int>>>g(n);
        for(auto it:edges){
            g[it[1]].push_back({it[0],it[2]});
        }
        queue<pair<int,int>>q;
        vector<int>nodeWeight(n,1e9);
        nodeWeight[0]=0;
        q.push({0,0});
        while(q.size()){
            int node= q.front().first;
            int srcWt=q.front().second;
            q.pop();
            for(auto it:g[node]){
                int dstNode=it.first;
                int edgeWt=it.second;

                if(nodeWeight[dstNode]>max(edgeWt,srcWt)){
                    nodeWeight[dstNode]=max(edgeWt,srcWt);
                    q.push({dstNode,nodeWeight[dstNode]});
                    // cout<<"source Node :"<<node<<" source Weight :"<<srcWt<<" dstNode :"<<dstNode<<" dstEdgeWt :"<<nodeWeight[dstNode]<<" edge Weight"<<edgeWt<<endl;
                }
            }
        }
        int ans=-1;
        for(auto it:nodeWeight){
            ans=max(ans,it);
        }
        return ans==1e9?-1:ans;
    }
};
```
['C++']