Skip to content

Commit ea8ce4c

Browse files
authored
Update string-compression-ii.cpp
1 parent baa6007 commit ea8ce4c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

C++/string-compression-ii.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ class Solution {
3030
private:
3131
int length(int cnt) {
3232
int l = ((cnt >= 2) ? 2 : 1);
33-
for (; cnt >= 10; cnt /= 10) {
34-
++l;
35-
}
33+
for (; cnt >= 10; cnt /= 10, ++l);
3634
return l;
3735
}
3836
};

0 commit comments

Comments
 (0)