3 ms·
From "Longest Common Substring" > p LCSLength('waaaa', 'bbbbasfaaewra') #returns 4 Visual inspection suggests the longest common substring is 'aa' which has le
by billforsternz 12y ago
From "Longest Common Substring"
> p LCSLength('waaaa', 'bbbbasfaaewra') #returns 4
Visual inspection suggests the longest common substring is 'aa' which has length 2. What am I missing here?
- mkinitcpio 12y agoLCS stands for "Longest Common Subsequence". I don't know why their docs say "substring". Maybe they just made a mistake? https://en.wikipedia.org/wiki/Longest_common_subsequence_problem https://en.wikipedia.org/wiki/Longest_common_subsequence_pro...
- billforsternz 12y agoThat explains it, thanks. Amusingly the wikipedia "longest common subsequence" page emphasises that this is different to and commonly confused with the "longest common substring". Illustrating this confusion neatly, the OP's repository implements subsequence, but is not only called substring but documented by a wikipedia link to substring!
- sagivo 12y agoalready updated. thanks for pointing it out