Available question text
Given a tree (n ≤ 15), count for each d=1..n-1 how many connected node subsets (subtrees) have diameter exactly d — i.e., enumerate connected subsets and determine their maximum pairwise distance. The small n suggests bitmask enumeration with connectivity/longest-path checks.
Related questions
Continue with questions that share topics or the same question type.
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 1617. Count Subtrees With Max Distance Between Cities
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source