NeetCode #450LC-129MediumTrees
← Back to All Problems

#450 · #129 · Sum Root to Leaf Numbers(求根节点到叶节点数字之和)

📌 Problem Statement & Constraints

You are given the root of a binary tree containing digits from 0 to 9. Each root-to-leaf path represents a number formed by concatenating the digits. Return the total sum of all such numbers. Constraints: the number of nodes is in [1, 1000], 0 <= Node.val <= 9, the depth is at most 10.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!