Skip to main content
Redundant Connection | AlgoCracked
AlgoCracked
ProblemsRedundant Connection
Medium63.0% acceptance
Blind75DfsBfsGraphUnion Find

Redundant Connection

You start with a tree on n nodes labelled 1…n (a connected, acyclic graph) and add one extra undirected edge, producing edges where edges[i] = [u, v] . Return the one edge that can be removed so the result is again a tree. If more than one edge qualifies, return the edge that appears last in edges . Input format Input is [edges] , e.g. [[[1,2],[1,3],[2,3]]] .

Loading workspace…