<garvit244>111_1.py
def minDepth( root):
    if not root:
        return 0
    depth = float('inf')
    stack = [(root, 1)]
    
    while stack:
        node, level = stack.pop()
        if node:
    
            if not node.left and not node.right:
                depth = min(depth, level)
    
            stack.append((node.left, level+1))
            stack.append((node.right, level+1))
    
    return depth
def sample_funcname ( var_0 ) :
    if not var_0 :
        return 0
    var_4 = float ( 'inf' )
    var_6 = [ ( var_0 , 1 ) ]
    while var_6 :
        var_8 , var_9 = var_6.pop ( )
        if var_8 :
            if not var_8.left and not var_8.right :
                var_4 = min ( var_4 , var_9 )
            var_6.append ( ( var_8.left , var_9 + 1 ) )
            var_6.append ( ( var_8.right , var_9 + 1 ) )
    return var_4
