leetcode 1584 (minimal spanning tree)
IntroductionGiven a connected and undirected graph, aspanning treeof that graph is a subgraph that is a tree and connects all the vertices together. Aminimum spanning tree (MST)or minimum weight spanning tree for a weighted, connected, undirected gra