Java Union Find 97.69% faster
```\n\tint[] parent;\n    public boolean[] distanceLimitedPathsExist(int n, int[][] edgeList, int[][] queries) {\n        int qSize= queries.length, eSize= edge
```\n\tint[] parent;\n    public boolean[] distanceLimitedPathsExist(int n, int[][] edgeList, int[][] queries) {\n        int qSize= queries.length, eSize= edgeList.length;\n        parent= new int[n];\n        for(int i=0; i<n; i++) parent[i]= i;\n        Arrays.sort(edgeList,(a,b)->a[2]-b[2]);\n        int[][] sortedQ= new int[qSize][];\n        boolean[] res= new boolean[qSize];\n        for(int i=0; i<qSize; i++){\n            sortedQ[i]= new int[]{queries[i][0],queries[i][1],queries[i][2],i};\n        }\n        Arrays.sort(sortedQ,(a,b)->a[2]-b[2]);\n        int index= 0;\n        for(int[] query: sortedQ){\n            while(index<eSize && edgeList[index][2]<query[2]) union(edgeList[index][0],edgeList[index++][1]);\n            res[query[3]]= find(query[0])==find(query[1]);\n        }\n        return res;\n    }\n    public void union(int v1, int v2){\n        int group1= find(v1), group2= find(v2);\n        parent[group1]= group2;\n    }\n    public int find(int v){\n        while(v!=parent[v]){\n            parent[v]= parent[parent[parent[v]]];\n            v= parent[v];\n        }\n        return v;\n    }
[]