# -*- coding:utf-8 -*- classSolution: def__init__(self): self.stack=[] defpush(self, node): # write code here if self.stack: self.stack.append((node,min(node,self.stack[-1][1]))) else: self.stack.append((node,node))
defpop(self): # write code here if self.stack: self.stack.pop() deftop(self): # write code here if self.stack: return self.stack[-1][0] defmin(self): # write code here if self.stack: return self.stack[-1][1]