Skip to content

Commit 581b406

Browse files
authored
Update recover-a-tree-from-preorder-traversal.cpp
1 parent 6bb7435 commit 581b406

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/recover-a-tree-from-preorder-traversal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Solution {
2121
int j = S.find_first_not_of("-", i);
2222
int level = j - i;
2323
i = j;
24-
while (stack.size() != level) {
24+
while (stack.size() > level) {
2525
stack.pop_back();
2626
}
2727
j = S.find_first_of("-", i);

0 commit comments

Comments
 (0)