Skip to content

Commit 215322e

Browse files
authored
Update occurrences-after-bigram.cpp
1 parent 368644d commit 215322e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

C++/occurrences-after-bigram.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ class Solution {
3030
}
3131
if (c != ' ') {
3232
third.push_back(c);
33-
} else {
34-
k -= second.length() + third.length() + 1;
35-
result.emplace_back(move(third));
36-
i = 0, j = 0;
33+
continue;
3734
}
35+
k -= second.length() + third.length() + 1;
36+
i = 0, j = 0;
37+
result.emplace_back(move(third));
3838
}
3939
if (!third.empty()) {
4040
result.emplace_back(move(third));
41-
i = 0, j = 0;
4241
}
4342
return result;
4443
}

0 commit comments

Comments
 (0)