def recursive_lcs(var1, var2, length1, length2):
    """
    :param var1: variable
    :param var2: 2nd variable to compare and finding longest common sub seqeuence
    :param length1: length of variable
    :param length2: length of 2nd variable
    :return: return length of longest common subsequence

    examples:
    >>> recursive_lcs("abcd", "abxbxbc", 4, 7)
    3
    >>> recursive_lcs([1, 2, 4, 3], [1, 2, 3, 4], 4, 4)
    3
    """
    if length1 == 0 or length2 == 0:
        return 0
    elif var1[length1 - 1] == var2[length2 - 1]:
        return 1 + recursive_lcs(var1, var2, length1 - 1, length2 - 1)
    else:
        return max(
            recursive_lcs(var1, var2, length1, length2 - 1),
            recursive_lcs(var1, var2, length1 - 1, length2),
        )