更正 1047.删除字符串中的所有相邻重复项.md python方法一代码的错误
This commit is contained in:
parent
13293e8c2f
commit
5e3d23fa38
|
|
@ -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) # 字符串拼接
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue