wuyijia

导航

2023年8月26日 #

栈基础题20、496、232

摘要: 20. 有效的括号 1 class Solution: 2 #遍历完字符串后,栈是空的,说明全部匹配了 3 def isValid(self, s: str) -> bool: 4 stack = [] 5 #剪枝 6 if len(s) % 2 != 0: 7 return False 8 9 f 阅读全文

posted @ 2023-08-26 20:03 小吴要努力 阅读(5) 评论(0) 推荐(0) 编辑