Hacker News new | past | comments | ask | show | jobs | submit login

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?




LCS 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_pro...


That 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!


already updated. thanks for pointing it out




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: