#684

Redundant Connection

medium· Graphsruns: 0

In a graph that started as a tree of n nodes labeled 1 to n, one additional edge was added. You are given the resulting array of edges. Return an edge that can be removed so that the result is a tree of n nodes. If there are multiple answers, return the one that occurs last in the input.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.