Closed fanerge closed 3 years ago
// 使用 dp 时,声明二维数组时应该为 dp[s1.length + 1][s2.length + 1], 否则有边界条件没包括 如:longestCommonSequence("fo", "fisssssssss") 此时dp为: [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NaN], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NaN] ]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
// 使用 dp 时,声明二维数组时应该为 dp[s1.length + 1][s2.length + 1], 否则有边界条件没包括 如:longestCommonSequence("fo", "fisssssssss") 此时dp为: [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NaN], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NaN] ]