Skip to content

Commit 5c8dec2

Browse files
authored
Update convert-to-base-2.cpp
1 parent d677182 commit 5c8dec2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/convert-to-base-2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Solution2 {
2424
while (N) {
2525
int r = N % BASE;
2626
if (r < 0) {
27-
r += abs(BASE);
27+
r -= BASE;
2828
++N;
2929
}
3030
result += to_string(r);

0 commit comments

Comments
 (0)