Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree

Given an undirected weighted connected graph with n vertices numbered 0 to n - 1, implement solve(n, edges) where each edge is [u, v, weight] in input order. An edge is critical if every minimum spanning tree contains it. An edge is pseudo-critical if at least one minimum spanning tree contains it but it is not critical. Return [critical, pseudo] where each list contains original edge indices in ascending order. Edges in neither list belong to no minimum spanning tree.

Examples
Input: [5,[[0,1,1],[1,2,1],[2,3,2],[0,3,2],[0,4,3],[3,4,3],[1,4,6]]]
Output: [[0,1],[2,3,4,5]]
Hints

Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree

Given an undirected weighted connected graph with `n` vertices numbered `0` to `n - 1`, implement `solve(n, edges)` where each edge is `[u, v, weight]` in input order. An edge is critical if every minimum spanning tree contains it. An edge is pseudo-critical if at least one minimum spanning tree contains it but it is not critical. Return `[critical, pseudo]` where each list contains original edge indices in ascending order. Edges in neither list belong to no minimum spanning tree.