Search
⌘K

Leetcode 3367. Maximize Sum of Weights after Edge Removals

Given a weighted tree, remove edges so that each node's degree in the remaining forest is at most k while maximizing the total weight of retained edges (n up to 1e5). The core challenge is globally choosing which incident edges to keep for each node under the degree constraint to maximize the retained sum.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.