def iterative_lcs(var1, var2):
    """
    :param var1: variable
    :param var2: 2nd variable to compare and finding common sequence
    :return: return length of longest common subsequence

    examples:
    >>> iterative_lcs("abcd", "abxbxbc")
    3
    >>> iterative_lcs([1, 2, 4, 3], [1, 2, 3, 4])
    3
    """
    length1 = len(var1)
    length2 = len(var2)
    dp = [[0] * (length2 + 1) for _ in range(length1 + 1)]

    for i in range(length1 + 1):
        for j in range(length2 + 1):
            if i == 0 or j == 0:
                dp[i][j] = 0
            elif var1[i - 1] == var2[j - 1]:
                dp[i][j] = dp[i - 1][j - 1] + 1
            else:
                dp[i][j] = max(dp[i][j - 1], dp[i - 1][j])
    return dp[length1][length2]