Maximum Sum Leaf to Root Path in Binary Tree
Given a binary tree, find the maximum sum path from any leaf node to the root. Example: Input: A binary tree where 10 is the root, 30 and 15 are its children, and 20 and 5 are children of 30. Output: 60. Explanation: There are three leaf-to-root paths: 20->30->10 (sum=60), 5->30->10 (sum=45), and 15->10 (sum=25). The maximum sum is 60, achieved by the path 20->30->10.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Hello Interview Premium
Your account is free and you can post anonymously if you choose.