更正 1047.删除字符串中的所有相邻重复项.md python方法一代码的错误

This commit is contained in:
Eyjan_Huang
2021-08-20 02:59:10 +08:00
committed by GitHub
parent 13293e8c2f
commit 5e3d23fa38

View File

@ -203,9 +203,9 @@ class Solution:
res = list() res = list()
for item in s: for item in s:
if res and res[-1] == item: if res and res[-1] == item:
t.pop() res.pop()
else: else:
t.append(item) res.append(item)
return "".join(res) # 字符串拼接 return "".join(res) # 字符串拼接
``` ```