We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aab47d3 commit d33c76eCopy full SHA for d33c76e
problems/1047.删除字符串中的所有相邻重复项.md
@@ -164,7 +164,7 @@ class Solution {
164
int top = -1;
165
for (int i = 0; i < s.length(); i++) {
166
char c = s.charAt(i);
167
- // 当 top > 0,即栈中有字符时,当前字符如果和栈中字符相等,弹出栈顶字符,同时 top--
+ // 当 top >= 0,即栈中有字符时,当前字符如果和栈中字符相等,弹出栈顶字符,同时 top--
168
if (top >= 0 && res.charAt(top) == c) {
169
res.deleteCharAt(top);
170
top--;
0 commit comments