Critical Connections in a Network
A network has n servers labeled 0..n-1 connected by undirected connections forming a connected graph. A critical connection is an edge whose removal disconnects some servers (a bridge). Return all critical connections in any order.
Open official problem prompt ↗Identify every edge whose removal would split the previously connected network into pieces.
In a road map, a bridge is a road that is the only way across a river - remove it and the two sides are cut off, whereas roads inside a loop always have an alternate route.
- Input
- n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]
- Output
- [[1,3]]
- Why
- Edges 0-1, 1-2, 2-0 form a cycle so none is critical; removing 1-3 isolates server 3, so 1-3 is the only bridge.
2 <= n <= 10^5n - 1 <= connections.length <= 10^50 <= ai, bi <= n - 1ai != biThere are no repeated connectionsThe graph is connected