Available question text
Given a tree (or connected graph) with certain nodes marked as houses and unit travel time along edges, compute the minimum time to start at a given root and visit all house nodes (optionally returning to the start). The core challenge is to prune subtrees with no houses and use DFS/post-order accumulation to count only the necessary edge traversals, minimizing repeated travel (a tree-specific optimization of TSP-like routing).
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 3540. Minimum Time to Visit All Houses
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source