leetcode1003

 class Solution:
def isValid(self, S: str) -> bool:
n = len(S)
if n % 3 != 0:
return False
while n!=0:
i = S.find('abc')
if i == -1:
return False
else:
S = S[0:i] + S[i+3:]
n = len(S)
return True
上一篇:PostScript学习:另一种缩写为PS的技术


下一篇:enumerate