Medium
090Redundant Connection
Given edges of an undirected graph that started as a tree plus one extra edge, return the edge that creates a cycle.
EXAMPLES
Example 1
Input
{
"edges": [
[
1,
2
],
[
1,
3
],
[
2,
3
]
]
}
Output
[
2,
3
]FUNCTION SHAPE
edges: intMatrix→intArray