[Python] Simples O(1) solution using tuples
\n        ## RC ##\n        ## APPROACH : make tuples (x,y) \n        # where x is element directly given and y is always minElement i.e y will have minElement 
```\n        ## RC ##\n        ## APPROACH : make tuples (x,y) \n        # where x is element directly given and y is always minElement i.e y will have minElement in the current existing list ##\n        \n\t\t## TIME COMPLEXITY : O(1) ##\n\t\t## SPACE COMPLEXITY : O(N) ##\nclass MinStack:\n    def __init__(self):\n        self.stack = []\n    def push(self, x: int) -> None:\n        if self.stack:\n            self.stack.append((x, min(x, self.getMin())))\n        else:\n            self.stack.append((x,x))\n\n    def pop(self) -> None:\n        if self.stack:\n            self.stack.pop()\n\n    def top(self) -> int:\n        return self.stack[-1][0] if self.stack else None\n\n    def getMin(self) -> int:\n        return self.stack[-1][1] if self.stack else None\n```
['Python', 'Python3']