sumNumbers = function(root) {
    
  let total = 0;
  const dfs = (node, num) => {
      if(!node.left && !node.right) {
          num = num + node.val;
          total += +num;
          return;
      }

      node.left && dfs(node.left, num + node.val);
      node.right && dfs(node.right, num + node.val);
  }

  dfs(root, "");
  return total;
}
Tree | pre-order-traversal
Time O(n) | Space O(n)
https://leetcode.com/problems/sum-root-to-leaf-numbers
@param {TreeNode} root
@return {number}