We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
No description provided.
The text was updated successfully, but these errors were encountered:
动态规划经典题目!
const LCS = function (strA, strB) { let dp = new Array(strA.length + 1).fill(0).map(item => new Array(strB.length + 1).fill(0)); for (let i = 1; i <= strA.length; i++) { for (let j = 1; j <= strB.length; j++) { if (strA[i] === strB[j]) { dp[i][j] = dp[i - 1][j - 1] + 1; } else { dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]); } } } return dp[strA.length][strB.length]; }
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: