mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
更正 1047.删除字符串中的所有相邻重复项.md python方法一代码的错误
This commit is contained in:
@ -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) # 字符串拼接
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user