Given the root node root of a binary tree where each node contains a single digit, treat every root to leaf path as a base
Return the sum of all such numbers across every root to leaf path in the tree.
A leaf is a node with no children.
Constraints:
The number of nodes in the tree is in the range
Node.val
The depth of the tree will not exceed
Given the root node root of a binary tree where each node contains a single digit, treat every root to leaf path as a base
Return the sum of all such numbers across every root to leaf path in the tree.
A leaf is a node with no children.
Constraints:
The number of nodes in the tree is in the range
Node.val
The depth of the tree will not exceed