Find the Maximum Ancestor Value Across All Leaf Nodes in a Binary Tree
Given a binary tree, for each leaf node find the maximum value among all of its ancestor nodes (from root to that leaf's parent). Return the maximum of these per-leaf ancestor maximums across all leaves in the tree.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late December, 2024
Mid-level
Maximum Ancestor for Leaves
Hello Interview Premium
Your account is free and you can post anonymously if you choose.