Problem 684 · Medium

Redundant Connection

Use Union-Find to detect the first edge that forms a cycle in an undirected graph.

Open the interactive visualisation