Skip to content

Commit d33c76e

Browse files
committed
纠正 problems/1047.删除字符串中的所有相邻重复项.md 中java版本相关注释:将top>0纠正为top>=0
1 parent aab47d3 commit d33c76e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

problems/1047.删除字符串中的所有相邻重复项.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class Solution {
164164
int top = -1;
165165
for (int i = 0; i < s.length(); i++) {
166166
char c = s.charAt(i);
167-
// 当 top > 0,即栈中有字符时,当前字符如果和栈中字符相等,弹出栈顶字符,同时 top--
167+
// 当 top >= 0,即栈中有字符时,当前字符如果和栈中字符相等,弹出栈顶字符,同时 top--
168168
if (top >= 0 && res.charAt(top) == c) {
169169
res.deleteCharAt(top);
170170
top--;

0 commit comments

Comments
 (0)