题解 | #包含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)

全部评论

相关推荐

06-19 19:06
门头沟学院 Java
码农索隆:别去东软,真学不到东西,真事
点赞 评论 收藏
分享
醉蟀:你不干有的是人干
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务