Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3544. Subtree Inversion Sum
Choose a set of nodes whose subtree values are negated to maximize the total sum, with the constraint that any two inverted nodes that are ancestor and descendant must be at least k edges apart. This is a rooted-tree selection problem with long-range ancestor–descendant constraints (n up to 5e4, k ≤ 50), typically solved by a tree DP tracking distances/parities of flips along paths.
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.