Dijkstra || path with minimum effort
Intuitionwhat is the maximum edge value traversed on the path to reach this nodeminimize this valueApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
what is the maximum edge value traversed on the path to reach this node

minimize this value

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    O(Elogv)

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
    O(Elogv)

# Code
```cpp []
#define ll long long
#define vi vector<ll>
#define vii vector<vi>
#define pl pair<ll,ll>

#define ff first
#define ss second


void make_adj(vii &edges, vector<vector<pl>>&adj){
    
    for(auto it: edges){
        
        ll u = it[0];
        ll v = it[1];
        ll w = it[2];
        
        adj[u].push_back({v, w});
    
    }
    
    return;
    
    
}

ll solve(vii &edges, ll threshold, ll n){
    
    vector<vector<pl>> adj(n);
    
    make_adj(edges, adj);
    
    
    //start the dijkstra 
    vi dist(n, 1e9);
    
    priority_queue<pl, vector<pl>, greater<pl> > pq;
    
    
    pq.push({0, 0});
    dist[0] = 0;
    
    while(!pq.empty()){
        auto top = pq.top();
        pq.pop();
        
        ll u = top.ss;
        ll w = top.ff;
        
        
        //go to its adjacency 
        for(auto it: adj[u]){
            
            ll n_node = it.ff;
            ll wt_node = it.ss;
            
            if(dist[n_node] > max(w, wt_node)){
                dist[n_node] = max(w, wt_node);
                pq.push({max(w, wt_node), n_node});
            }
            
            
        }
        
    }
    
    
    for(auto it: dist){
        if(it >= 1e9) return -1;
    }
    
    
    ll maxi = 0;
    for(auto it: dist){
        maxi = max(maxi, it);
    }
    
    
    return maxi;
    
    
    
    
}


class Solution {
public:
    int minMaxWeight(int n, vector<vector<int>>& edges, int threshold) {
        //reverse the edges 
        vii newedges;
        for(auto it: edges){
            ll u = it[0];
            ll v = it[1];
            ll w = it[2];
            
            newedges.push_back({v, u, w});
            
        }
        
        
        
        ll ans = solve(newedges, threshold, n);
        
        return ans;
        
    }
};
```
['Graph', 'C++']