Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- Subtree Inversion Sum II
Coding
- Most Frequent Subtree Sum
Coding
- 2 Sum in leetcode question
Coding
- Alternating Digit Sum
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3544. Subtree Inversion Sum
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source