Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2378. Choose Edges to Maximize Score in a Tree
Given a tree and an integer k, pick k edges whose removal (or selection) maximizes a score defined by each edge's contribution based on the sizes of the two resulting sides when cut (typically subtree_size*(n - subtree_size)). Key ideas are computing subtree sizes to get per-edge contributions, then greedily/strategically selecting and combining the largest contributions (with attention to multiplier handling or modulo arithmetic where required).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.