From 5e3d23fa38c78b9e66f12bd0e768968d7f31ed6c Mon Sep 17 00:00:00 2001 From: Eyjan_Huang <81480748+Eyjan-Huang@users.noreply.github.com> Date: Fri, 20 Aug 2021 02:59:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=201047.=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E4=B8=AD=E7=9A=84=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=9B=B8=E9=82=BB=E9=87=8D=E5=A4=8D=E9=A1=B9.md=20python?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=80=E4=BB=A3=E7=A0=81=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/1047.删除字符串中的所有相邻重复项.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) # 字符串拼接 ```