We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b82a338 commit f247d62Copy full SHA for f247d62
C++/number-of-digit-one.cpp
@@ -5,6 +5,7 @@ class Solution {
5
public:
6
int countDigitOne(int n) {
7
static const int DIGIT = 1;
8
+
9
int is_zero = (DIGIT == 0) ? 1 : 0;
10
int result = is_zero;
11
for (int64_t base = 1; n >= base; base *= 10) {
0 commit comments