<doocs>0988.Smallest String Starting From Leaf_1.py
def dfs(root, path):
    nonlocal ans
    if root:
        path.append(chr(ord('a') + root.val))
        if root.left is None and root.right is None:
            ans = min(ans, ''.join(reversed(path)))
        dfs(root.left, path)
        dfs(root.right, path)
        path.pop()
def sample_funcname ( var_1 , var_2 ) :
    nonlocal var_3
    if var_1 :
        var_2.append ( chr ( ord ( 'a' ) + var_1.val ) )
        if var_1.left is None and var_1.right is None :
            var_3 = min ( var_3 , ''.join ( reversed ( var_2 ) ) )
        var_0 ( var_1.left , var_2 )
        var_0 ( var_1.right , var_2 )
        var_2.pop ( )
