diff --git a/problems/1047.删除字符串中的所有相邻重复项.md b/problems/1047.删除字符串中的所有相邻重复项.md index 1d63e7f8..b60a8d1d 100644 --- a/problems/1047.删除字符串中的所有相邻重复项.md +++ b/problems/1047.删除字符串中的所有相邻重复项.md @@ -203,9 +203,9 @@ class Solution: res = list() for item in s: if res and res[-1] == item: - t.pop() + res.pop() else: - t.append(item) + res.append(item) return "".join(res) # 字符串拼接 ```