<garvit244>1007_1.py
def minDominoRotations( A, B):
    if len(A) != len(B):
        return -1
    if len(A) == 0:
        return 0
    
    for possibility in set([A[0], B[0]]):
        top_rotation, bottom_rotation =0, 0
        for a_num, b_num in zip(A, B):
            if possibility not in [a_num, b_num]:
                break
            top_rotation += int(b_num != possibility)
            bottom_rotation += int(a_num != possibility)
        else:
            return min(top_rotation, bottom_rotation)
    return -1
def sample_funcname ( var_0 , var_1 ) :
    if len ( var_0 ) != len ( var_1 ) :
        return - 1
    if len ( var_0 ) == 0 :
        return 0
    for var_6 in set ( [ var_0 [ 0 ] , var_1 [ 0 ] ] ) :
        var_7 , var_8 = 0 , 0
        for var_10 , var_11 in zip ( var_0 , var_1 ) :
            if var_6 not in [ var_10 , var_11 ] :
                break
            var_7 += int ( var_11 != var_6 )
            var_8 += int ( var_10 != var_6 )
        else :
            return min ( var_7 , var_8 )
    return - 1
