<garvit244>1022_1.py
def traversal(root, paths, pathlen, allpaths):
    if not root:
        return 
    if len(paths) > pathlen:
        paths[pathlen] = root.val
    else:
        paths.append(root.val)
        
    pathlen +=1
    if not root.left and not root.right:
        allpaths.append(int(''.join(str(val) for val in paths[0:pathlen]), 2))
    else:
        traversal(root.left, paths, pathlen, allpaths)
        traversal(root.right, paths, pathlen, allpaths)
def sample_funcname ( var_1 , var_2 , var_3 , var_4 ) :
    if not var_1 :
        return
    if len ( var_2 ) > var_3 :
        var_2 [ var_3 ] = var_1.val
    else :
        var_2.append ( var_1.val )
    var_3 += 1
    if not var_1.left and not var_1.right :
        var_4.append ( int ( ''.join ( str ( val ) for val in var_2 [ 0 : var_3 ] ) , 2 ) )
    else :
        var_0 ( var_1.left , var_2 , var_3 , var_4 )
        var_0 ( var_1.right , var_2 , var_3 , var_4 )
