You are given an integer n representing the number of vertices in an undirected connected graph, with vertices labeled from n edges, where edges[i] = [u_i, v_i, w_i] denotes an undirected edge between vertices u_i and v_i with weight w_i, and an integer k.
You can remove any number of edges from the graph to split it into at most k connected components. The cost of a connected component is defined as the maximum weight of any edge present in that component, or
Return the minimum possible maximum cost among all components after splitting the graph into at most k connected components.
Constraints:
n
edges.length
edges[i].length
u_i, v_i n
w_i
k n
The input graph is connected.
You are given an integer n representing the number of vertices in an undirected connected graph, with vertices labeled from n edges, where edges[i] = [u_i, v_i, w_i] denotes an undirected edge between vertices u_i and v_i with weight w_i, and an integer k.
You can remove any number of edges from the graph to split it into at most k connected components. The cost of a connected component is defined as the maximum weight of any edge present in that component, or
Return the minimum possible maximum cost among all components after splitting the graph into at most k connected components.
Constraints:
n
edges.length
edges[i].length
u_i, v_i n
w_i
k n
The input graph is connected.