//求两个字符串的最长公共子串的长度(子串不一定是原串中的连续子串组成)
//LCS
//使用动态规划
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int lcs_len(string s1, string s2){
int len1 = s1.size(), len2 = s2.size();
if (len1==0 || len2==0)
C++实现——LCS-最大公共子串长度
最新推荐文章于 2023-09-22 10:57:04 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)