Approach hintTry it first, then revealHide
Add the edges to a DSU in input order. The first edge whose endpoints already share a root closes the only cycle, and it is the edge to return.
Add the edges to a DSU in input order. The first edge whose endpoints already share a root closes the only cycle, and it is the edge to return.