Skip to content

Commit 5254226

Browse files
authored
Update number-of-digit-one.cpp
1 parent 3ba5b20 commit 5254226

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/number-of-digit-one.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
class Solution {
55
public:
66
int countDigitOne(int n) {
7-
int64_t pivot = 1;
87
int result = 0;
8+
int64_t pivot = 1;
99
while (n >= pivot) {
1010
result += n / (10 * pivot) * pivot +
1111
min(pivot, max(n % (10 * pivot) - pivot + 1, 0l));

0 commit comments

Comments
 (0)