You have n servers connected by cables. Some cables are critical: if you remove one, some servers become unreachable. Find all critical cables. Return them as a list of edges.
This is a classic application of bridge-finding algorithms like Tarjan's. Run a single DFS and track discovery times and low-link values. An edge is a bridge if low[v] > disc[u]. This means the subtree rooted at has no back edge reaching above , so removing disconnects 's subtree.