Sum root to leaf numbers
Your task
Given a binary tree as a level-order array (null for missing) where every node value is a digit 0-9, each root-to-leaf path spells a number formed by concatenating the digits from root to leaf. Return the sum of all such numbers. If the tree is empty, return 0.
Examples
sum_root_to_leaf(level: list) -> intExample 1
Input
sum_root_to_leaf([1, 2, 3])Output
25