会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Loading
Think twice, code once.
首页
新随笔
管理
2024年9月15日
[最大最长]最长有效括号的长度
摘要: class Solution: def longestValidParentheses(self, s: str) -> int: stack = [-1] max_len = 0 for i in range(len(s)): if s[i] == "(": stack.append(i) eli
阅读全文
posted @ 2024-09-15 22:36 Duancf
阅读(14)
评论(0)
推荐(0)