Java Kruskals
\nclass Solution {\n    \n    int[][] edges;\n    int n;\n    \n    public List<List<Integer>> findCriticalAndPseudoCriticalEdges(int _n, int[][] _edges) {\n   
```\nclass Solution {\n    \n    int[][] edges;\n    int n;\n    \n    public List<List<Integer>> findCriticalAndPseudoCriticalEdges(int _n, int[][] _edges) {\n        this.edges = _edges;\n        this.n = _n;\n        List<Integer> critical = new ArrayList<Integer>();\n        List<Integer> nonCritical = new ArrayList<Integer>();\n        Map<int[],Integer> graph = new HashMap<int[],Integer>();\n        for(int i = 0; i<edges.length;i++)graph.put(edges[i],i);\n        Arrays.sort(edges,(a,b)->a[2]-b[2]);\n        int minSpanningTree = findMinSpanningTree(0,-1);\n        for(int i = 0; i<edges.length;i++){\n            int index = graph.get(edges[i]);\n            if(findMinSpanningTree(0,i)>minSpanningTree)critical.add(index);\n            else if(findMinSpanningTree(i,-1)==minSpanningTree)nonCritical.add(index);\n        }\n        return List.of(critical,nonCritical);\n    }\n    \n    private int findMinSpanningTree(int start, int skip){\n        UnionFind uf = new UnionFind(n);\n        int cost = 0;\n        if(skip!=0){\n           uf.union(edges[start][0],edges[start][1]);\n           cost+=edges[start][2]; \n        }\n        for(int i =0; i<edges.length;i++){\n            if(i==skip)continue;\n            int[] edge = edges[i];\n            if(uf.find(edge[0])!=uf.find(edge[1])){\n                uf.union(edge[0],edge[1]);\n                cost+=edge[2];\n            }\n        }\n        return uf.count == n-1 ? cost : Integer.MAX_VALUE;\n    }\n    \n    class UnionFind{\n        \n        int[] parent;\n        int count;\n        \n        public UnionFind(int n){\n            this.parent = new int[n];\n            this.count = 0;\n            for(int i = 0;i<n;i++)this.parent[i] = i;\n        }\n        \n        public void union(int a, int b){\n            this.count++;\n            a = find(a);\n            b = find(b);\n            parent[a] = b;\n        }\n        \n        public int find(int n){\n            while(parent[n]!=n){\n                n = parent[n];\n            }\n            return n;\n        }\n    }\n}\n```
['Java']