Assume a large set of arrays of individual words (not phrases), e.g.
{"One", "two", "three", "four"}
{"One", "two", "three"}
{"One", "two", "where", "are", "you"}
{"One", "other"}
{"Two", "three", "four"}
{"More", "more", "more"}
Given another array of individual words, what would be the most efficient (fastest) way of finding the longest common match, left to right, other than the "brute force" solution (i.e., continuous string matching)?
For example, given the array {"One", "two", "three", "four", "five"}
the longest common match in the above list would be {"One", "two", "three", "four"}
.