hard
Critical Connections in a Network
A network of n servers is connected by undirected links so that every server can reach every other. A link is critical if removing it disconnects some pair of servers. Return all critical links.
Constraints
- 2 ≤ n ≤ 10^5
- n - 1 ≤ connections.length ≤ 10^5
- No repeated links
Examples
in: n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]
out: [[1,3]]
Code it yourself
Solve in
Test execution is not yet available for this exercise.Practice journal →Draft saved in this browser.
Hints:
Which approach applies?
Choose an approach to check your pattern recognition, or reveal the discussion when you need help.