Problem 684 · Medium
Use Union-Find to detect the first edge that forms a cycle in an undirected graph.
Open the interactive visualisation