Skip to content

Commit ec6ec30

Browse files
authored
Update minimum-increments-for-target-multiples-in-an-array.cpp
1 parent 138d31a commit ec6ec30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/minimum-increments-for-target-multiples-in-an-array.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Solution {
2929
// submask enumeration:
3030
// => sum(nCr(n, k) * 2^k for k in xrange(n+1)) = (1 + 2)^n = 3^n
3131
// => Time: O(3^n), see https://cp-algorithms.com/algebra/all-submasks.html
32-
int new_mask = ((1 << m) - 1) - mask;
32+
const int new_mask = ((1 << m) - 1) - mask;
3333
for (int submask = new_mask; submask; submask = (submask - 1) & new_mask) {
3434
dp[mask | submask] = min(dp[mask | submask], dp[mask] + (x % lcms[submask] ? lcms[submask] - x % lcms[submask] : 0));
3535
}

0 commit comments

Comments
 (0)