Search
⌘K

Leetcode 366. Find Leaves of Binary Tree

Given a binary tree, repeatedly remove all current leaf nodes and record their values until the tree is empty, returning a list of lists where each inner list contains the leaves removed in that round. The key challenge is grouping nodes by their removal round (i.e., their height from the bottom), which can be computed via a post-order traversal.

Asked at:

Oracle

Google

Google

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late February, 2026

Oracle

Mid-level

Exact copy of Find Leaves of Binary Tree on leetocde

Late December, 2024

Google

Google

Mid-level

Recursively delete leave nodes in a multi-tree

Early December, 2024

Amazon

Amazon

Mid-level

Remove leaf nodes from a binary tree and print them, with variations on removal order

Your account is free and you can post anonymously if you choose.