given a stack a function removemin accepts a stack as a parameter and removes the smallest value from the stack for example bottom 2 8 3 6 7 3 top after removeminstack bottom 2 8 3 7 3 top find the smallest value back up stack and remove min value stack is empty find the smallest value back up stack and remove min value
def remove_min(stack):
    storage_stack = []
    if len(stack) == 0:  
        return stack
    
    min = stack.pop()
    stack.append(min)
    for i in range(len(stack)):
        val = stack.pop()
        if val <= min:
            min = val
        storage_stack.append(val)
    
    for i in range(len(storage_stack)):
        val = storage_stack.pop()
        if val != min:
            stack.append(val)
    return stack