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