Using one stack, simple and concise, [C++]
Implementation\n\nTime Complexity = O(1)\n\n\nclass MinStack {\nprivate:\n    stack<int> s;\n    int min = INT_MAX;\n    \npublic:    \n    MinStack() {        
Implementation\n\n**Time Complexity = O(1)**\n\n```\nclass MinStack {\nprivate:\n    stack<int> s;\n    int min = INT_MAX;\n    \npublic:    \n    MinStack() {        \n    }\n    \n    void push(int val) {\n        if(val <= min){\n            s.push(min);    \n            min = val;\n        }        \n        s.push(val);\n    }\n    \n    void pop() {        \n        if(s.top() == min) {\n            s.pop();\n            min = s.top();            \n        }\n        s.pop();\n    }\n    \n    int top() {\n        return s.top();\n    }\n    \n    int getMin() {\n        return min;\n    }\n};\n```\nIf you find any issue in understanding the solution then comment below, will try to help you.\nIf you found my solution useful.\nSo **please do upvote and encourage me** to document all leetcode problems\uD83D\uDE03\nHappy Coding **:)**
['Stack', 'C']