← SAP questions
CodingReported in a candidate post, Oct 2020

Sum of all leaf nodes in a binary tree

Filed under SAP · Also reported at Amagi, MathWorks

Given the root of a binary tree, calculate and return the sum of all its leaf nodes.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related SAP questions

Collected from public candidate posts and coding forums. Updated Nov 2026.