algorithms-js
algorithms-js copied to clipboard
Implemented longest common subsequence algorithm
I want partially resolve #8 by adding implementation of Longest common subsequence
Hi, tests that you've written only check response value's length. Once I changed them to check an acctual algorithm result one of tests doesn't pass.
it('should find baba or abab for abaabbaaa and babab', () => {
const stringA = 'abaabbaaa';
const stringB = 'babab';
const result = logestcommonsubsequence(stringA, stringB);
assert.equal(['baba', 'abab'].indexOf(result) !== -1, true);
});
I guess the problem is in your readSolution function. Let me know If you want to work on this. If the answer is negative. I'll be more than happy to fix this :)