3608. Minimum Time for K Connected Components
You are given an integer
nand an undirected graph withnnodes labeled from 0 ton - 1. This is represented by a 2D arrayedges, whereedges[i] = [ui, vi, timei]indicates an undirected edge between nodesuiandvithat can be removed attimei.You are also given an integer
k.Initially, the graph may be connected or disconnected. Your task is to find the minimum time
tsuch that after removing all edges withtime <= t, the graph contains at leastkconnected components.Return the minimum time
t.A connected component is a subgraph of a graph in which there exists a path between any two vertices, and no vertex of the subgraph shares an edge with a vertex outside of the subgraph.
1 | class Solution { |