Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static int digits2(int num) {
if (num < 0) {
num = num * -1;
}
return (int)(Math.log10(num)) + 1;
return (int)(Math.log10(num)) + 1; //return the number of letters-1 so, we add 1 to it, to make it equal to the length of the number
}

// count number of digits in a number
Expand Down