Critical Connections in a Network

Problem Description

There are n servers numbered 0 to n-1 connected by undirected server-to-server connections. A critical connection is a connection that, if removed, will make some servers unable to reach some other server. Return all critical connections in any order. Each connection can be returned in any order within the pair. Example: Input: n=4, connections=[[0,1],[1,2],[2,0],[1,3]] Output: [[1,3]] Explanation: [1,3] is the only bridge — removing it disconnects server 3. DE Shaw Tier 2 — LC 1192 (Tarjan's bridge-finding algorithm). Optimal: Tarjan's DFS O(V+E). Track disc[] (discovery time) and low[] (lowest disc reachable). Edge (u,v) is a bridge if low[v] > disc[u] — no back edge exists from v's subtree to u or above.

Example Test Cases

Example 1
Input: [4,[[0,1],[1,2],[2,0],[1,3]]]
Expected: [[1,3]]
Example 2
Input: [2,[[0,1]]]
Expected: [[0,1]]

Run your code to see the results