Solution
C++ []\nclass MinStack {\npublic:\n    typedef struct node{\n        int v;\n        int minUntilNow;\n        node* next;\n    }node;\n\n    MinStack() : topN(
```C++ []\nclass MinStack {\npublic:\n    typedef struct node{\n        int v;\n        int minUntilNow;\n        node* next;\n    }node;\n\n    MinStack() : topN(nullptr){\n        \n    }\n    \n    void push(int val) {\n        node* n = new node;\n        n->v = n->minUntilNow = val;\n        n->next = nullptr;\n        \n        if(topN == nullptr){\n            topN = n;\n        }\n\n        else{\n            n->minUntilNow = min(n->v,topN->minUntilNow);\n            n->next = topN;\n            topN = n;\n        }\n    }\n    \n    void pop() {\n        topN = topN->next;\n    }\n    \n    int top() {\n        return topN->v;\n    }\n    \n    int getMin() {\n        return topN->minUntilNow;\n    }\n\n    private:\n    node* topN;\n};\n```\n\n```Python3 []\nclass MinStack:\n\n    def __init__(self):\n        self.stack = []\n        self.minStack = []\n\n    def push(self, val: int) -> None:\n        self.stack.append(val)\n        if self.minStack:\n            val = min(self.minStack[-1],val)\n        self.minStack.append(val)\n\n    def pop(self) -> None:\n        self.stack.pop()\n        self.minStack.pop()\n\n    def top(self) -> int:\n        return self.stack[-1]\n\n    def getMin(self) -> int:\n        return self.minStack[-1]\n```\n\n```Java []\nclass MinStack {\n    LinkedList<TplusMin> stack;\n    private class TplusMin {\n        int val;\n        int min;\n        public TplusMin(int val, int min) {\n            this.val = val;\n            this.min = min;\n        }\n    }\n\n    public MinStack() {\n        stack = new LinkedList<>();\n    }\n    \n    public void push(int val) {\n        int newMin;\n        if (stack.size() == 0){\n            newMin = val;\n        }\n        else {\n            int currentMin = stack.getFirst().min;\n            newMin = val < currentMin ? val : currentMin;\n        }\n        stack.addFirst(new TplusMin(val, newMin));\n    }\n    \n    public void pop() {\n        stack.removeFirst();\n    }\n    \n    public int top() {\n        return stack.peekFirst().val;\n    }\n    \n    public int getMin() {\n        return stack.peekFirst().min;\n    }\n}\n```\n
['C++', 'Java', 'Python3']