题解 | #包含min函数的栈#
包含min函数的栈
https://www.nowcoder.com/practice/4c776177d2c04c2494f2555c9fcc1e49
# -*- coding:utf-8 -*- s = [] class Solution: def push(self, node): # write code here s.append(node) def pop(self): # write code here return s.pop() def top(self): # write code here return s[-1] def min(self): # write code here return min(s)