Available question text
Given a tree rooted at 0 with some nodes containing apples, find the minimum seconds (1 per edge traversal) to start at 0, collect all apples, and return to 0 — equivalently sum 2× each edge that lies on any path to an apple, which can be found by a post-order DFS that prunes subtrees without apples. (n up to 1e5.)
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
Meta
Leetcode 1443. Minimum Time to Collect All Apples in a Tree
Reported Sep 30, 2025 · 3 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View source