Very concise Java solution with Deque interface
The solution is pretty straightforward, keep a minStack besides the underlying stack. During push: push a new item if it's smaller or equals than the current mi
The solution is pretty straightforward, keep a minStack besides the underlying stack. During push: push a new item if it's smaller or equals than the current minimum. During pop: if the current item to be popped equals to the top of minStack then pop that one aswell.\n\n    Deque<Integer> stack = new LinkedList<>();\n    Deque<Integer> minStack = new LinkedList<>();\n    \n    public void push(int x) {\n        stack.push(x);\n        if(minStack.isEmpty() || minStack.peek() >= x) {\n            minStack.push(x);\n        }\n    }\n\n    public void pop() {\n        int x = stack.pop();\n        if(x == minStack.peek()) {\n            minStack.pop();\n        }\n    }\n\n    public int top() {\n        return stack.peek();\n    }\n\n    public int getMin() {\n        return minStack.peek();\n    }
['Queue', 'Java']