Skip to content

Commit 5f0133f

Browse files
committed
Update generalized-abbreviation.cpp
1 parent 9f25cc9 commit 5f0133f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

C++/generalized-abbreviation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class Solution {
1919
generateAbbreviationsHelper(word, i + 1, cur, res);
2020
cur->pop_back();
2121
if (cur->empty() || not isdigit(cur->back())) {
22-
for (int len = 1; i + len <= word.length(); ++len) {
23-
cur->append(to_string(len));
24-
generateAbbreviationsHelper(word, i + len, cur, res);
25-
cur->resize(cur->length() - to_string(len).length());
22+
for (int l = 1; i + l <= word.length(); ++l) {
23+
cur->append(to_string(l));
24+
generateAbbreviationsHelper(word, i + l, cur, res);
25+
cur->resize(cur->length() - to_string(l).length());
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)