Elegant Python DFS | 98.66%, 82.23%
\nclass Solution:\n    def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]:\n    \n        graph = defaultdict(list)\n       
```\nclass Solution:\n    def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]:\n    \n        graph = defaultdict(list)\n        for node1, node2 in connections:\n            graph[node1].append(node2), graph[node2].append(node1)\n            \n        arrival_time = [None]*n\n        critical_connections = []\n        def dfs(node = 0, parent = -1, time = 1):\n            if arrival_time[node]: return\n            arrival_time[node] = time\n            for neighbour in graph[node]:\n                if neighbour == parent: continue \n                dfs(neighbour, node, time + 1)\n                if arrival_time[neighbour] == time + 1: critical_connections.append((node, neighbour))\n                else: arrival_time[node] = min(arrival_time[node], arrival_time[neighbour])\n            return critical_connections\n        \n        return dfs()\n```
['Depth-First Search', 'Recursion', 'Python', 'Python3']