Skip to content

Commit 2397adb

Browse files
authored
Update count-symmetric-integers.cpp
1 parent 03ecc5e commit 2397adb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

C++/count-symmetric-integers.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ class Solution {
1313
if (size(digits) % 2) {
1414
LOOKUP[x - 1] = 0;
1515
} else {
16-
int curr1 = 0;
16+
int total1 = 0;
1717
for (int i = 0; i < size(digits) / 2; ++i) {
18-
curr1 += digits[i] - '0';
18+
total1 += digits[i] - '0';
1919
}
20-
int curr2 = 0;
20+
int total2 = 0;
2121
for (int i = size(digits) / 2; i < size(digits); ++i) {
22-
curr2 += digits[i] - '0';
22+
total2 += digits[i] - '0';
2323
}
24-
LOOKUP[x - 1] = curr1 == curr2 ? 1 : 0;
24+
LOOKUP[x - 1] = total1 == total2 ? 1 : 0;
2525
}
2626
}
2727
return LOOKUP[x - 1];

0 commit comments

Comments
 (0)