
    Given a list of transaction pairs where each pair represents money transfers between two bank accounts, write a function that identifies and counts the number of bidirectional transaction patterns (where Account A transfers to Account B and Account B transfers to Account A) to detect potential circular money movements. The function should consider (Account A, Account B) and (Account B, Account A) as a single bidirectional pattern when counting.
    

    
def count_bidirectional(test_list):
    """
    Given a list of transaction pairs where each pair represents money transfers between two bank accounts, write a function that identifies and counts the number of bidirectional transaction patterns (where Account A transfers to Account B and Account B transfers to Account A) to detect potential circular money movements. The function should consider (Account A, Account B) and (Account B, Account A) as a single bidirectional pattern when counting.
    

    """
def count_bidirectional(test_list):
    """
    Given a list of transaction pairs where each pair represents money transfers between two bank accounts, write a function that identifies and counts the number of bidirectional transaction patterns (where Account A transfers to Account B and Account B transfers to Account A) to detect potential circular money movements. The function should consider (Account A, Account B) and (Account B, Account A) as a single bidirectional pattern when counting.
    

    """
    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