#3608

Minimum Time for K Connected Components

specialist · 950 · lc medium +32 · 45.2% accepted · 124 likes · top 28%

Description

An undirected graph has n nodes and edges [ui, vi, timei] where each edge is removed at time timei.

Given integer k, find the minimum time t such that after removing all edges with removal-time <= t, at least k connected components remain.

Return that minimum time t.

Code

1
2
3