classMinStack:def__init__(self):""" initialize your data structure here. """ self.stack = []defpush(self,x:int) ->None: self.stack.append(x)defpop(self) ->None: self.stack.pop()deftop(self) ->int:return self.stack[-1]defgetMin(self) ->int:returnmin(self.stack)# Your MinStack object will be instantiated and called as such:# obj = MinStack()# obj.push(x)# obj.pop()# param_3 = obj.top()# param_4 = obj.getMin()