There is an undirected tree with edges of length edges[i] k.
You may remove any number of edges from the tree such that in the resulting graph, every node is connected to at most k other nodes.
Return the maximum possible total sum of edge weights of the remaining edges.
Constraints:
k
edges.length
edges[i].length
edges[i][0]
edges[i][1]
edges[i][2]
The input is generated such that edges represents a valid tree.
There is an undirected tree with edges of length edges[i] k.
You may remove any number of edges from the tree such that in the resulting graph, every node is connected to at most k other nodes.
Return the maximum possible total sum of edge weights of the remaining edges.
Constraints:
k
edges.length
edges[i].length
edges[i][0]
edges[i][1]
edges[i][2]
The input is generated such that edges represents a valid tree.