We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 595319b commit b8a5193Copy full SHA for b8a5193
Dynamic-Programming/LongestCommonSubsequence.js
@@ -23,7 +23,7 @@ function longestCommonSubsequence(x, y, str1, str2, dp) {
23
function main() {
24
const str1 = "ABCDGH"
25
const str2 = "AEDFHR"
26
- let dp = new Array(str1.length + 1).fill(0).map(x => new Array(str2.length + 1).fill(0))
+ const dp = new Array(str1.length + 1).fill(0).map(x => new Array(str2.length + 1).fill(0))
27
const res = longestCommonSubsequence(str1.length - 1, str2.length - 1, str1, str2, dp)
28
console.log(res);
29
}
0 commit comments