Available question text
For each node in a rooted tree, find the maximum sum of a subset of nodes in its subtree such that across the chosen nodes each decimal digit 0–9 appears at most once, then return the sum of all these per-node maxima modulo 1e9+7. The core challenge is a tree DP that merges children using 10-bit masks (2^10 states) representing used digits and discards nodes whose own value has repeated digits.
Related questions
Continue with questions that share topics or the same question type.
- Maximum Score of a Good Subarray
Coding
- Find and Count Maximum-Score Grid Paths
Coding · Dynamic Programming · Grids & Matrices
- Find the Maximum Divisibility Score
Coding
- Find the Maximum Factor Score of Array
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 3575. Maximum Good Subtree Score
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source