A tree of n nodes labelled 1 to n had one extra edge added between two of its nodes. Given the resulting n undirected edges, return an edge that can be removed so the remaining edges form a tree of n nodes. If there are several answers, return the one that appears last in the input.
Practise this challenge
All coding challenges