Class Solution
- java.lang.Object
-
- g1101_1200.s1192_critical_connections_in_a_network.Solution
-
public class Solution extends Object
1192 - Critical Connections in a Network.Hard
There are
nservers numbered from0ton - 1connected by undirected server-to-serverconnectionsforming a network whereconnections[i] = [ai, bi]represents a connection between serversaiandbi. Any server can reach other servers directly or indirectly through the network.A critical connection is a connection that, if removed, will make some servers unable to reach some other server.
Return all critical connections in the network in any order.
Example 1:

Input: n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]
Output: 1,3
Explanation: 3,1 is also accepted.
Example 2:
Input: n = 2, connections = [[0,1]]
Output: 0,1
Constraints:
2 <= n <= 105n - 1 <= connections.length <= 1050 <= ai, bi <= n - 1ai != bi- There are no repeated connections.
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<List<Integer>>criticalConnections(int n, List<List<Integer>> connections)
-