Tarjan Bridges Algorithm, Python, faster than 98.73%
Here is an excellent explanation of the algorithm:\nhttps://www.youtube.com/watch?v=aZXi1unBdJA\n\npython\nclass Solution:\n    # Tarjan bridges algorithm\n    
Here is an excellent explanation of the algorithm:\nhttps://www.youtube.com/watch?v=aZXi1unBdJA\n\n```python\nclass Solution:\n    # Tarjan bridges algorithm\n    def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]:\n        graph = { i: [] for i in range(n) }\n        for edge in connections:\n            a, b = edge\n            graph[a].append(b)\n            graph[b].append(a)\n            \n        return self.findBridges(n, graph)\n    \n    def findBridges(self, n, graph):\n        id = 0\n        ids = [0 for _ in range(n)]\n        lowLinks = [0 for _ in range(n)]\n        visited = [False for _ in range(n)]\n        bridges = []\n        for i in range(n):\n            if not visited[i]:\n                self.dfs(i, -1, bridges, graph, id, visited, ids, lowLinks)\n        return bridges\n    \n    def dfs(self, node, parent, bridges, graph, id, visited, ids, lowLinks):\n        visited[node] = True\n        id += 1\n        lowLinks[node] = id\n        ids[node] = id\n        \n        for nextNode in graph[node]:\n            if nextNode == parent:\n                continue\n            if not visited[nextNode]:\n                self.dfs(nextNode, node, bridges, graph, id, visited, ids, lowLinks)\n                lowLinks[node] = min(lowLinks[node], lowLinks[nextNode])\n                if ids[node] < lowLinks[nextNode]:\n                    bridges.append([node, nextNode])\n            else:\n                lowLinks[node] = min(lowLinks[node], ids[nextNode])\n```
[]