EDIT: See comments. This solution is not correct.

NOTE: in this implementation, push is O(log(n)). So this solution is worth discussing with your interviewer, but it may or may not be acceptable.

```
class MinStack {
public:
/** initialize your data structure here. */
MinStack() {
//myStack = new stack<int>();
//myMinHeap = new priority_queue<int, vector<int>, greater<int> >();
}
void push(int x) {
myStack.push(x);
myMinHeap.push(x);
}
void pop() {
int temp = myStack.top();
myStack.pop();
if (temp == getMin()){
myMinHeap.pop();
}
}
int top() {
return myStack.top();
}
int getMin() {
return myMinHeap.top();
}
private:
stack<int> myStack;
priority_queue<int, vector<int>, greater<int> > myMinHeap;
};
```