
    Write a function to count unique pairs of linked financial products in a customer's portfolio, where each pair represents a bidirectional relationship between two banking products (such as a savings account linked to an investment account). The function should consider (a,b) and (b,a) as the same relationship pair when counting, and each product can be part of multiple relationships.
    

    
def count_bidirectional(test_list):
    """
    Write a function to count unique pairs of linked financial products in a customer's portfolio, where each pair represents a bidirectional relationship between two banking products (such as a savings account linked to an investment account). The function should consider (a,b) and (b,a) as the same relationship pair when counting, and each product can be part of multiple relationships.
    

    """
def count_bidirectional(test_list):
    """
    Write a function to count unique pairs of linked financial products in a customer's portfolio, where each pair represents a bidirectional relationship between two banking products (such as a savings account linked to an investment account). The function should consider (a,b) and (b,a) as the same relationship pair when counting, and each product can be part of multiple relationships.
    

    """
    res = 0
    for idx in range(0, len(test_list)):
        for iidx in range(idx + 1, len(test_list)):
            if test_list[iidx][0] == test_list[idx][1] and test_list[idx][1] == test_list[iidx][0]:
                res += 1
    return res