Java solution (accepted)
private Stack<Integer> mStack = new Stack<Integer>();\n\tprivate Stack<Integer> mMinStack = new Stack<Integer>();\n\t\n\tpublic void push(int x) {\n\t\tmStack.p
    private Stack<Integer> mStack = new Stack<Integer>();\n\tprivate Stack<Integer> mMinStack = new Stack<Integer>();\n\t\n\tpublic void push(int x) {\n\t\tmStack.push(x);\n\t\tif (mMinStack.size() != 0) {\n\t\t\tint min = mMinStack.peek();\n\t\t\tif (x <= min) {\n\t\t\t\tmMinStack.push(x);\n\t\t\t}\n\t\t} else {\n\t\t\tmMinStack.push(x);\n\t\t}\n    }\n\n    public void pop() {\n    \tint x = mStack.pop();\n\t\tif (mMinStack.size() != 0) {\n\t\t\tif (x == mMinStack.peek()) {\n\t\t\t\tmMinStack.pop();\n\t\t\t}\n\t\t}\n    }\n\n    public int top() {\n    \treturn mStack.peek();\n    }\n\n    public int getMin() {\n        return mMinStack.peek();\n    }
[]