Minimum Operations to Connect the Network
Medium
Bridges & Connectivity
There are n computers (0..n-1) and some cables. One operation moves a cable to join two computers. Print the minimum operations to connect everything or -1 if impossible.
Constraints
1 <= n <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.