[Java] Two stacks. So simple
\nclass MinStack {\n\n    Stack<Integer> stack;\n    Stack<Integer> minStack;\n    \n    /** initialize your data structure here. */\n    public MinStack() {\n 
```\nclass MinStack {\n\n    Stack<Integer> stack;\n    Stack<Integer> minStack;\n    \n    /** initialize your data structure here. */\n    public MinStack() {\n        stack = new Stack<>();\n        minStack = new Stack<>();\n    }\n    \n    public void push(int x) {\n        stack.push(x);\n        if (minStack.isEmpty() || x <= minStack.peek()) {\n            minStack.push(x);\n        }\n    }\n    \n    public void pop() {\n        if (stack.peek().equals(minStack.peek())) minStack.pop();\n        stack.pop();\n    }\n    \n    public int top() {\n        return stack.peek();\n    }\n    \n    public int getMin() {\n        return minStack.peek();\n    }\n}\n```
['Java']