The problem. n servers, numbered 0 to n - 1, are joined by two-way connections into one connected network. A connection is critical if removing it leaves some server unable to reach another. Return all critical connections, in any order.
n = 4, connections = [[0,1],[1,2],[2,0],[1,3]] -> [[1,3]]
n = 2, connections = [[0,1]] -> [[0,1]]Members only · free account
The rest of this lesson, with 6 more sections, 2 drawings, a dry-run simulator and code in JavaScript, Python, Java and C++, opens with a free account.
Was this helpful?
Not ready yet? The Arrays course is free to read, no account needed.
In the rest of this lesson