Beats- 86%✅ || O(1)✅||6 Lines Solution✅||Beginner Friendly✅
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass MinStack {\npublic:\n    stack<int> st1,st2;\n    void push(int val) {\n        if(st1.empty()){st1.push(val);st2.push(val);return ;}\n        st1.push(val); st2.push(min(val,st2.top()));\n    }\n    void pop() {\n        if(st1.empty()){return ;}\n        st1.pop();st2.pop();\n    }\n    int top(){ return st1.top();}\n    int getMin(){ return st2.top();}\n};\n```
['Math', 'Stack', 'C++']