Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: Intersecting Two Stringsby lima1 (Curate) |
on Aug 22, 2007 at 12:38 UTC ( [id://634325]=note: print w/replies, xml ) | Need Help?? |
It seems that OP's problem is an easy special case of the LCS problem. We have one big string S and 2 substrings (seq1, seq2) with known coordinates within S:
So it's a trivial O(1) algorithm to calculate the overlap with the substring positions and lengths.
In Section
Seekers of Perl Wisdom
|
|