C++ || Stack of pair || TC : O(1) & SC : O(n) ✔
here i had created stack of pair\nin pair first element is origin element which is pushed but second is for maintain minimum.\nso this way we maintain min stack
here i had created stack of pair\nin pair first element is origin element which is pushed but second is for maintain minimum.\nso this way we maintain **min stack**\n**Time Complexity : O(1)\nSpace Complexity : O(n)**  *(specifically Space Complexity is O(2 * n) as we store 2 value for one pushed value)*\n```\nclass MinStack {\npublic:\n\tstack<pair<int, int>>s;\n\tMinStack() {\n\n\t}\n\n\tvoid push(int val) {\n\t\tif (!s.empty()) {\n\t\t\ts.push({val, min(val, s.top().second)});\n\t\t}\n\t\telse {\n\t\t\ts.push({val, val});\n\t\t}\n\t}\n\n\tvoid pop() {\n\t\ts.pop();\n\t}\n\n\tint top() {\n\t\treturn s.top().first;\n\t}\n\n\tint getMin() {\n\t\treturn s.top().second;\n\t}\n};\n```\n\n**If you find it helpful *Upvote it* \uD83D\uDC4D**
['Stack', 'C']