Keep Failing test #20 and #21


def multiply_optimized(poly1, poly2):

    if len(poly1) == 1 or len(poly2) == 1:
        return multiply_basic(poly1,poly2)
    elif poly1 == [0] or poly2 == [0]:
        return [0]
    elif poly1 == [] or poly2 ==[]:
        return []
    else:
        n = max(len(poly1),len(poly2))
        A,B = split(poly1,poly2)
        Y = multiply_optimized(add(A[0],A[1]),add(B[0],B[1]))
        U = multiply_optimized(A[0],B[0])
        Z = multiply_optimized (A[1],B[1])
        Y_U_Z = add(Y,[x*-1 for x in add(U,Z)])

        return add(add(U,increase_exponent(Y_U_Z,n//2)),increase_exponent(Z,2*(n//2)))

This code of mine keeps failing test case # 20 and #21. The test case #20 keeps giving recursion error and 21 is just failing. Any help would be appreciated!