change deque to stack for min-stack