azl397985856 / fe-interview

宇宙最强的前端面试指南 (https://lucifer.ren/fe-interview)
Apache License 2.0
2.83k stars 260 forks source link

修改 dp 实现,部分测试用例不通过 #155

Closed fanerge closed 3 years ago

fanerge commented 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] ]

stale[bot] commented 3 years ago

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.