Solution 1 DP

  • t-complexity: $O(m*n)$

  • s-complexity: $O(m*n)$

dp[i][j] 是 text1 以 i 结尾,text2 以 j 结尾,的LCS

Last updated