Akuna Capital
1 DSA problems asked in Akuna Capital coding interviews
0 Easy
1 Medium
0 Hard
All Categories
All
1 problem
Graph1
Number of Operations to Make Network Connected
Medium
There are n computers numbered 0 to n - 1 joined by ethernet cables, where connections[i] = [a, b] links computers a and b. Any computer can reach any other through the network directly or indirectly. In one operation you may unplug a cable between two directly connected computers and plug it between any pair of disconnected computers. Return the minimum number of operations needed to connect all the computers, or -1 if it is not possible.