```
public class MinStack {
Stack<Integer> s,minS;
/** initialize your data structure here. */
public MinStack() {
s = new Stack<>();
minS = new Stack<>();
}
public void push(int x) {
s.push(x);
if(!minS.isEmpty() && minS.peek() < x) return;
minS.push(x);
}
public void pop() {
// int p = s.pop();
// if (p == minS.peek()) minS.pop();
if(s.pop() == minS.peek()) minS.pop();
}
public int top() {
return s.peek();
}
public int getMin() {
return minS.peek();
}
}
```

In the method "pop", I don't know why this one

```
if(s.pop() == minS.peek()) minS.pop();
```

doesn't pass, but the comment one does

```
int p = s.pop();
if (p == minS.peek()) minS.pop();
```

I feel like they are the same...

Any Idea?