Neel Smith on github Openly available work in digital classics

Gists for LCS and SCS of two strings

I’ve published a pair of gists with groovy scripts using the listutils package to find the LCS and SCS of two strings of characters. They are predictably named:

Examples:

groovy lcs.groovy 'Dr Rock-and-Roll Star' 'Doctor Rock Star'

prints

Dr Rock Star

while

groovy scs.groovy 'Dr Rock-and-Roll Star' 'Doctor Rock Star'

prints

Doctor Rock-and-Roll Star