1/28
Loading...
🎯Find Farthest Servers!
Let's find how many servers are farthest from the main server (1)!
Loading...
Let's find how many servers are farthest from the main server (1)!
A data center has N servers with network connections between them. We want to find servers farthest from the main server (server 1). Distance is measured by minimum hops (number of connections traversed). Find the count of servers farthest from server 1.
6, [[3,6], [4,3], [3,2], [1,3], [1,2], [2,4], [5,2]]
3
Distance from 1: 2->1, 3->1, 4->2, 5->2, 6->2. 3 nodes at distance 2 (4,5,6)