Easy Java Solution || Dijkstra || Shortest Path || Ignore Threshold
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

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

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

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

# Code
```java []
class Solution {
    static ArrayList<int[]> graph[];

    static int findWeight(int n, int threshold){
        PriorityQueue<int[]> pq = new PriorityQueue<>((a,b)->a[1]-b[1]);
        pq.add(new int[]{0,0});
        int vis[] = new int[n];
        vis[0] = 1;
        int nodeWeight[] = new int[n];
        Arrays.fill(nodeWeight,(int)1e9);
        nodeWeight[0] = 0;
        int maxWeight = 0;
        while(pq.size()!=0){
            int curr[] = pq.remove();
            int node = curr[0];
            int wt = curr[1];
         //   System.out.println(node+" "+wt);
            if(vis[node]!=1) maxWeight = Math.max(maxWeight,wt);
            vis[node] = 1;

            for(var child : graph[node]){
                if(vis[child[0]]==0 && nodeWeight[child[0]]>child[1]){
                    nodeWeight[child[0]] = child[1];
                    pq.add(new int[]{child[0],child[1]});
                }
            }
        }

        // for(int i=0; i<n; i++){
        //     System.out.println(vis[i]+" "+nodeWeight[i]);
        // }

        for(int i=0; i<n; i++){
            if(vis[i]==0) return -1;
        }
        return maxWeight;
    }
    public int minMaxWeight(int n, int[][] edges, int threshold) {
        graph = new ArrayList[n];
        for(int i=0; i<n; i++){
            graph[i] = new ArrayList<>();
        }

        for(var e : edges){
            int st = e[0];
            int end = e[1];
            int wt = e[2];
            graph[end].add(new int[]{st,wt});
        }
        return findWeight(n,threshold);
    }
}
```
['Java']