[英]Longest common subsequence of more than 1 Letter in a string
I'm trying to find the LCS of more than one letter in two strings using a k
value.我正在尝试使用
k
值在两个字符串中查找多个字母的 LCS。 For example, if例如,如果
k = 3
s1 = "AAABBBCCCDDDEEE"
s2 = "AAACCCBBBDDDEEE"
then the LCS would be 4
: "AAABBBDDDEEE"
or "AAACCCDDDEEE"
, another example is if那么 LCS 将是
4
: "AAABBBDDDEEE"
或"AAACCCDDDEEE"
,另一个例子是如果
k = 2
s1 = "EEDDFFAABBCC"
s2 = "AACCDDEEBBFF"
then the LCS would be 2
: "EEBB"
, "EEFF"
, "DDFF"
, "DDBB"
, ... and so on.那么 LCS 将是
2
: "EEBB"
, "EEFF"
, "DDFF"
, "DDBB"
, ... 等等。 How would I be able to do it so that more than one character is in each cell of the table and if the characters are not equal I would have to use a sort, ie "EF" == "FE"
我怎样才能做到这一点,以便表格的每个单元格中有多个字符,如果字符不相等,我将不得不使用一种排序,即
"EF" == "FE"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.