Critical connections

Write codeHard40 minAmazon style

Your task

A network of n servers (labeled 0..n-1) is connected by undirected connections, where connections[i] = [a, b] is a bidirectional link. A connection is 'critical' if removing it disconnects some server from the rest of the network (a bridge). Return all critical connections, each as a pair [a, b]. Order of the returned pairs does not matter, and each pair may be in either order.

Examples

critical_connections(n: int, connections: list[list[int]]) -> list[list[int]]
Example 1
Inputcritical_connections(4, [[0, 1], [1, 2], [2, 0], [1, 3]])
Output[[1, 3]]