Easy C++ Solution using Stack of pairs
Create a stack of pairs \nwhere first element of pair stores the element\nsecond element of pair stores the min element seen so far\n1. INSERTION\npush element 
Create a stack of pairs \nwhere first element of pair stores the element\nsecond element of pair stores the min element seen so far\n1. INSERTION\npush element and min_element\n\n2. TOP\nreturn element from the top of stack\n\n3. MIN ELEMENT\nreturn min_element from the pair on top of the stack\n\n4. POP\npop the pair on top of stack \n\nCODE:\n```\nclass MinStack {\n    stack<pair<int,int>> sp;\npublic:\n    /** initialize your data structure here. */\n    MinStack() {\n        \n    }\n    \n    void push(int x) {\n        if(sp.empty())\n        sp.push({x,x});\n        else\n            sp.push({x,min(sp.top().second,x)});\n    }\n    \n    void pop() {\n        sp.pop();\n    }\n    \n    int top() {\n        return sp.top().first;\n    }\n    \n    int getMin() {\n        return sp.top().second;\n    }\n};
[]