Could any tell me why this is wrong? I tested it on Xcode and it passed.

```
class MinStack {
private:
vector<int> stack;
int min = NULL;
public:
/** initialize your data structure here. */
void push(int x) {
if (stack.empty()) min = x;
stack.push_back(x-min);
min = min < x ? min: x;
}
void pop() {
if (stack.empty()) return;
if (stack.back() < 0) min = min - stack.back();
stack.pop_back();
}
int top() {
if (stack.empty()) return NULL;
return stack.back() > 0 ? min + stack.back() : min;
}
int getMin() {
if (stack.empty()) return NULL;
return min;
}
};
```