题解 | #有效括号序列#

有效括号序列

https://www.nowcoder.com/practice/37548e94a270412c8b9fb85643c8ccc2

class Solution:
    def isValid(self , s: str) -> bool:
        # write code here
        while s:
            l = len(s)
            s = s.replace('()','').replace('[]','').replace('{}','')
            if l == len(s):
                break
        return True if len(s)<1 else False
#字节23秋招笔试太难了吧##你觉得一款游戏为什么好玩#
全部评论
好聪明的解法
点赞 回复 分享
发布于 2024-09-09 17:09 上海

相关推荐

敢逐云霄志:你打招呼语怎么能这么长,hr都没看下去的欲望,简明扼要说重点,就读于某某学校某某专业,26届应届毕业生,学信网可查,先后在某某公司实习过(如有),然后做过什么项目,想找一份什么样的工作,可实习几个月以上,期待您的回复。
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
10
收藏
分享

创作者周榜

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