Skip to content

Commit 9a3cde9

Browse files
committed
Fixed value declaration with const
1 parent 27daf7b commit 9a3cde9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

coin-change/nhistory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var coinChange = function (coins, amount) {
88
dp[0] = 0;
99

1010
for (let i = 0; i <= amount; i++) {
11-
for (let coin of coins) {
11+
for (const coin of coins) {
1212
if (coin <= i) dp[i] = Math.min(dp[i - coin] + 1, dp[i]);
1313
}
1414
}

maximum-product-subarray/nhistory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var maxProduct = function (nums) {
33
let max = 1,
44
min = 1;
55

6-
for (let num of nums) {
6+
for (const num of nums) {
77
const candidates = [min * num, max * num, num];
88
min = Math.min(...candidates);
99
max = Math.max(...candidates);

word-break/nhistory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var wordBreak = function (s, wordDict) {
99
return true;
1010
}
1111

12-
for (let word of wordDict) {
12+
for (const word of wordDict) {
1313
if (s.substring(start, start + word.length) === word) {
1414
if (dfs(start + word.length)) {
1515
memo[start] = true;

0 commit comments

Comments
 (0)