let stackmin=[]
function push(node)
{
    stack1.push(node)
    if(stackmin.length==0||stackmin[stackmin.length-1]>=node){
        stackmin.push(node)
    }
    else {
        stackmin.push(stackmin[stackmin.length-1])
    }
    // write code here
}
function pop()
{ 
         stackmin.pop()
        return stack1.pop()
    // write code here
}
//注意!!此处stackmin.pop()
//若stack中pop的是min,逻辑很直接。若stackpop的不是min,stackmin中重复输入了min
//不影响return min
function top()
{
    return stack1[stack1.length-1]
    // write code here
}
function min()
{
    return stackmin[stackmin.length-1]
    // write code here
}
module.exports = {
    push : push,
    pop : pop,
    top : top,
    min : min
};