Min Cost to Repair Edges (Min Spanning Tree II)

There's an undirected connected graph with n nodes labeled 1..n. But some of the edges has been broken disconnecting the graph.


This is a companion discussion topic for the original entry at https://algo.monster/problems/min_cost_to_repair_edges/