import java.util.*;
import java.util.Stack;
public class Solution {
// 使用双栈法解决当前问题,一个栈是正常记录,一个记录最小值
Stack<Integer> x = new Stack();
Stack<Integer> y = new Stack();
public void push(int node) {
x.push(node);
if (y.isEmpty() || y.peek() > node){
y.push(node);
} else{
y.push(y.peek());
}
}
public void pop() {
x.pop();
y.pop();
}
public int top() {
return x.peek();
}
public int min() {
return y.peek();
}
}