题目链接Leetcode_1143-最长公共子序列关键词{% label 动态规划 green %}、{% label 字符串 blue %}解析状态定义:dp[i][j]:表示前 text1[i] 个字符,与前 text2[j] 个字符中,能构成的最长公共子序列的长度状态方程:text1[i] == text2[j], dp[i][j] = dp[i - 1][j - 1] + 1text1[i] != text2[j], dp[i][j] = max(dp[i][j - 1], dp[i - 1][j])代码Author:CoderWddURL:https://www.wuinsights.top//article/d43ad59d42fbCopyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!Relate PostsLeetcode 2923. 找到冠军 ILeetcode1026. 节点与其祖先之间的最大差值Leetcode 1702. 修改后的最大二进制字符串Leetcode 894. 所有可能的真二叉树Leetcode_64-最小路径和Leetcode_907-子数组的最小值之和Leetcode_322-零钱兑换Leetcode_300-最长递增子序列