def big_l_array(p, lp):
    """
    Generate L array using pattern and L' array, Theorem 0.2.2, see proof
    :param p: the pattern
    :param lp: the L' array
    :return: the L array
    """
    l = [0] * len(p)
    l[1] = lp[1]
    for i in range(2, len(p)):
        l[i] = max(l[i - 1], lp[i])
    return l