A directed graph started as a rooted tree with
An additional directed edge was added to the tree. The resulting graph is provided as a edges of length edges[i] = [u_i, v_i] represents a directed edge pointing from node u_i to node v_i.
Return an edge that can be removed so that the remaining graph is a valid rooted tree of edges array.
Constraints:
n edges.length
n
edges[i].length
u_i, v_i n
u_i v_i
A directed graph started as a rooted tree with
An additional directed edge was added to the tree. The resulting graph is provided as a edges of length edges[i] = [u_i, v_i] represents a directed edge pointing from node u_i to node v_i.
Return an edge that can be removed so that the remaining graph is a valid rooted tree of edges array.
Constraints:
n edges.length
n
edges[i].length
u_i, v_i n
u_i v_i