Problems > The Sponsor's Cable > Editorial

The Sponsor's Cable — Solution & Editorial

Back to the Problem

Pre-merge edge K's endpoints (paying its weight), then run plain Kruskal on the rest — the exchange argument still applies to the remaining forest.

Complexity: O(M log M)