题解 | #有效括号序列#
有效括号序列
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秋招笔试太难了吧##你觉得一款游戏为什么好玩#
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秋招笔试太难了吧##你觉得一款游戏为什么好玩#