毁抨句 发表于 2025-6-11 14:20:10

算法day38-动态规划(11)

目录


[*]最长公共子序列
[*]不相交的线
[*]最大子序和
[*]判断子序列
一、最长公共子序列(不要求元素之间连续)

 https://leetcode.cn/problems/longest-common-subsequence/?envType=problem-list-v2&envId=8At1GmaZ

 
class Solution {    public int longestCommonSubsequence(String text1, String text2) {      int[][] dp = new int;      for(int i=1; i
页: [1]
查看完整版本: 算法day38-动态规划(11)