Skip to content

Commit 8cc5590

Browse files
authored
Update reformat-the-string.cpp
1 parent 84150e4 commit 8cc5590

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

C++/reformat-the-string.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ class Solution {
2424
}
2525
string result;
2626
while (result.length() < s.length()) {
27-
a = next_char(a, a_end, &count);
28-
b = next_char(b, b_end, &count);
29-
result.push_back(a);
30-
result.push_back(b);
27+
result.push_back(a = next_char(a, a_end, &count));
28+
result.push_back(b = next_char(b, b_end, &count));
3129
}
3230
if (result.back() == '\0') {
3331
result.pop_back();

0 commit comments

Comments
 (0)