Skip to content

Commit 15a2384

Browse files
authored
Update number-of-different-subsequences-gcds.cpp
1 parent cb76edd commit 15a2384

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/number-of-different-subsequences-gcds.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Solution {
1313
if (!nums_set.count(x)) {
1414
continue;
1515
}
16-
d = gcd(d, x);
16+
d = gcd(d, x); // total time: O(log(min(d, x)) = O(logd), where d keeps the same or gets smaller
1717
if (d == i) {
1818
++result;
1919
break;

0 commit comments

Comments
 (0)