def lcs_len(x, y):
    """
    Computes the length of the Longest Common Subsequence (LCS) between two lists using DP in O(nm).
    Implementation available on:
    https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_subsequence

    :type x: list of strings
    :param x: a sequence
    :type y: list of strings
    :param y: a sequence
    :return: the length of the LCS
    """
    m = len(x)
    n = len(y)

    C = [[0] * (n + 1) for _ in range(m + 1)]
    for i in range(1, m + 1):
        for j in range(1, n + 1):
            if x[i - 1] == y[j - 1]:
                C[i][j] = C[i - 1][j - 1] + 1
            else:
                C[i][j] = max(C[i][j - 1], C[i - 1][j])
    return C[m][n]