def _lcs(x, y):
    'Computes the length of the LCS between two seqs.\n\n  The implementation below uses a DP programming algorithm and runs\n  in O(nm) time where n = len(x) and m = len(y).\n  Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence\n\n  Args:\n    x: collection of words\n    y: collection of words\n\n  Returns:\n    Table of dictionary of coord and len lcs\n  '
    (n, m) = (len(x), len(y))
    table = dict()
    for i in range((n + 1)):
        for j in range((m + 1)):
            if ((i == 0) or (j == 0)):
                table[(i, j)] = 0
            elif (x[(i - 1)] == y[(j - 1)]):
                table[(i, j)] = (table[((i - 1), (j - 1))] + 1)
            else:
                table[(i, j)] = max(table[((i - 1), j)], table[(i, (j - 1))])
    return table
Computes the length of the LCS between two seqs.

The implementation below uses a DP programming algorithm and runs
in O(nm) time where n = len(x) and m = len(y).
Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence

Args:
  x: collection of words
  y: collection of words

Returns:
  Table of dictionary of coord and len lcs
def _lcs(x, y):
    'Computes the length of the LCS between two seqs.\n\n  The implementation below uses a DP programming algorithm and runs\n  in O(nm) time where n = len(x) and m = len(y).\n  Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence\n\n  Args:\n    x: collection of words\n    y: collection of words\n\n  Returns:\n    Table of dictionary of coord and len lcs\n  '
    (n, m) = (len(x), len(y))
    table = dict()
    for i in range((n + 1)):
        for j in range((m + 1)):
            if ((i == 0) or (j == 0)):
                table[(i, j)] = 0
            elif (x[(i - 1)] == y[(j - 1)]):
                table[(i, j)] = (table[((i - 1), (j - 1))] + 1)
            else:
                table[(i, j)] = max(table[((i - 1), j)], table[(i, (j - 1))])
    return table