Sum Root-to-Leaf Numbers in a Binary Tree
Given a binary tree whose node values are digits from 0 to 9, each root-to-leaf path represents a decimal number. For example, 1 -> 2 -> 3 represents 123. Return the sum of all root-to-leaf nu...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
