Algorithm from dynamic programming. It finds the longest common sub-sequence of two strings. For example for strings 'abcd' and 'axxcda' the longest common sub-sequence is 'acd'.
Longest common subsequence.
var subsequence = require('path-to-algorithms/src/searching/'+ 'longest-common-subsequence').longestCommonSubsequence; console.log(subsequence('abcd', 'axxcda'); // 'acd'