import std.stdio; string lcs(string a, string b) { int[][] lengths; lengths.length = a.length; for (int i=0; i greatestLength) { greatestLength = lengths[i][j]; int start = i-greatestLength+1; output = a[start..start+greatestLength]; } } else { lengths[i][j] = 0; } } } return output; } void main() { writeln(lcs("testing123testing", "thisisatest")); }