我需要把一个清单变成一个空洞的清单,如果它有两个带有某种财产的非重叠顺序。 例如,在这种情况下,等于并且长度和幅度;= 2)
mm[{___, b1__, ___, b1__, ___}] := {} /; Length[{b1}] >= 2
or, for example 2 sublists, with a similarity function equal 0 and Legth = 4
mm[{___, b1__, ___, b2__, ___}] := {} /;
NeedlemanWunschSimilarity[{b1}, {b2}] == 0 && Length[{b1}] == 4 &&
Length[{b2}] == 4
and so on.....
For mathematica, guru who know internal algorithm, is there a faster way, perhaps using PatternTest (?) ?