Minimum Spanning Tree Kruskal

Given a connected, undirected graph with n vertices and weighted edges, find the minimum total weight to connect all vertices using Kruskal's algorithm.

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

Minimum Spanning Tree Kruskal

Given a connected, undirected graph with n vertices and weighted edges, find the minimum total weight to connect all vertices using Kruskal's algorithm.