count servers numbered 0 to count - 1. The cable cables[i] = [a, b] directly links servers a and b, and data flows through it both ways. Right now every server can reach every other one, directly or through a chain of servers.
A cable is fragile if, once it breaks, there are two servers that can no longer reach each other.
Return all fragile cables as pairs [a, b]. Neither the order of the pairs nor the order of servers inside a pair matters.count=5, cables=[[0, 1], [1, 2], [2, 0], [2, 3], [3, 4]] → [[3, 4], [2, 3]]
Servers 0, 1, 2 form a ring, so any ring cable can be lost. Without [2, 3] or [3, 4], however, servers 3 and 4 are cut off. The pairs may be returned in any order, e.g. [[3, 4], [2, 3]].
count=4, cables=[[0, 1], [1, 2], [2, 3], [3, 0]] → []
All four servers sit on a ring: whichever cable breaks, the network stays connected.
count=3, cables=[[1, 0], [1, 2]] → [[1, 2], [0, 1]]
count=5, cables=[[0, 1], [1, 2], [2, 0], [2, 3], [3, 4]]
[[3, 4], [2, 3]]
Run checks the first 3 tests in your browser. Submit checks all 62 tests on the server, hidden ones included.