refactor, use less parameters
inputs can be strings or arrays, output of same type
lcs consists of indices of common elements instead of the elements themselves