<garvit244>1035_1.py
def maxUncrossedLines( A, B):
    dp = [[0]*len(A) for _ in range(len(B))]
    
    dp[0][0] = 1 if A[0] == B[0] else 0
    for index_i in range(1, len(dp)):
        dp[index_i][0] = dp[index_i-1][0]
        if A[0] == B[index_i]:
            dp[index_i][0] = 1
            
    for index_j in range(1, len(dp[0])):
        dp[0][index_j] = dp[0][index_j-1]
        if B[0] == A[index_j]:
            dp[0][index_j] = 1
            
    for index_i in range(1, len(dp)):
        for index_j in range(1, len(dp[0])):
            if A[index_j] == B[index_i]:
                dp[index_i][index_j] = max(dp[index_i-1][index_j-1] + 1, max(dp[index_i-1][index_j], dp[index_i][index_j-1]))
            else:
                dp[index_i][index_j] = max(dp[index_i-1][index_j-1], max(dp[index_i-1][index_j], dp[index_i][index_j-1]))
    return dp[len(B)-1][len(A)-1]
def sample_funcname ( var_0 , var_1 ) :
    var_6 = [ [ 0 ] * len ( var_0 ) for var_4 in range ( len ( var_1 ) ) ]
    var_6 [ 0 ] [ 0 ] = 1 if var_0 [ 0 ] == var_1 [ 0 ] else 0
    for var_8 in range ( 1 , len ( var_6 ) ) :
        var_6 [ var_8 ] [ 0 ] = var_6 [ var_8 - 1 ] [ 0 ]
        if var_0 [ 0 ] == var_1 [ var_8 ] :
            var_6 [ var_8 ] [ 0 ] = 1
    for var_9 in range ( 1 , len ( var_6 [ 0 ] ) ) :
        var_6 [ 0 ] [ var_9 ] = var_6 [ 0 ] [ var_9 - 1 ]
        if var_1 [ 0 ] == var_0 [ var_9 ] :
            var_6 [ 0 ] [ var_9 ] = 1
    for var_8 in range ( 1 , len ( var_6 ) ) :
        for var_9 in range ( 1 , len ( var_6 [ 0 ] ) ) :
            if var_0 [ var_9 ] == var_1 [ var_8 ] :
                var_6 [ var_8 ] [ var_9 ] = max ( var_6 [ var_8 - 1 ] [ var_9 - 1 ] + 1 , max ( var_6 [ var_8 - 1 ] [ var_9 ] , var_6 [ var_8 ] [ var_9 - 1 ] ) )
            else :
                var_6 [ var_8 ] [ var_9 ] = max ( var_6 [ var_8 - 1 ] [ var_9 - 1 ] , max ( var_6 [ var_8 - 1 ] [ var_9 ] , var_6 [ var_8 ] [ var_9 - 1 ] ) )
    return var_6 [ len ( var_1 ) - 1 ] [ len ( var_0 ) - 1 ]
