```
class MinStack {
public static int CAPACITY = 10;
public static int CUR = 0;
int [] a = new int[CAPACITY];
int [] min = new int[CAPACITY];
public void push(int x) {
if(CUR + 1 > CAPACITY){
CAPACITY *= 2;
int [] b = new int[CAPACITY];
int [] bMin = new int[CAPACITY];
for(int i=0;i<CUR;i++){
b[i] = a[i];
bMin[i] = min[i];
}
a = b;
min = bMin;
}
a[CUR] = x;
if(CUR==0){
min[CUR] = x;
}else{
min[CUR] = Math.min(x,min[CUR-1]);
}
CUR++;
}
public void pop() {
CUR--;
}
public int top() {
return a[CUR-1];
}
public int getMin() {
return min[CUR-1];
}
```

}

case:

Input: push(2),push(0),push(3),push(0),getMin,pop,getMin,pop,getMin,pop,getMin

Output: [0,0,0,0]

Expected: [0,0,0,2]