Skip to content

Commit 304e968

Browse files
authored
Update maximum-trailing-zeros-in-a-cornered-path.cpp
1 parent 0a1a77c commit 304e968

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

C++/maximum-trailing-zeros-in-a-cornered-path.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class Solution {
88
const auto& factor = [](int x) {
99
static const array<int, 2> primes = {2, 5};
1010
array<int, 2> cnt = {0, 0};
11-
for (int i = 0, y = x; i < size(primes); ++i) {
12-
while (y && y % primes[i] == 0) {
13-
y /= primes[i];
11+
for (int i = 0; i < size(primes); ++i) {
12+
while (x && x % primes[i] == 0) {
13+
x /= primes[i];
1414
++cnt[i];
1515
}
1616
}

0 commit comments

Comments
 (0)