<qiyuangong>129_Sum_Root_to_Leaf_Numbers_1.py
def sumNumbers( root):
    if root is None:
        return 0
    res = 0
    queue = [(root, root.val)]
    while len(queue) > 0:
        curr, curr_value = queue.pop(0)
        if curr.left is None and curr.right is None:
            res += curr_value
            continue
        if curr.left:
            queue.append((curr.left, curr_value * 10 + curr.left.val))
        if curr.right:
            queue.append((curr.right, curr_value * 10 + curr.right.val))
    return res
def sample_funcname ( var_0 ) :
    if var_0 is None :
        return 0
    var_3 = 0
    var_5 = [ ( var_0 , var_0.val ) ]
    while len ( var_5 ) > 0 :
        var_8 , var_9 = var_5.pop ( 0 )
        if var_8.left is None and var_8.right is None :
            var_3 += var_9
            continue
        if var_8.left :
            var_5.append ( ( var_8.left , var_9 * 10 + var_8.left.val ) )
        if var_8.right :
            var_5.append ( ( var_8.right , var_9 * 10 + var_8.right.val ) )
    return var_3
