
    Given a list of paired credit card transaction IDs where each pair represents money transfers between two accounts, write a function that identifies the number of bidirectional transaction patterns (where Account A has sent money to Account B, and Account B has also sent money to Account A). Each transaction pair should only be counted once, regardless of the order in which the transfers occurred.
    

    
def count_bidirectional(test_list):
    """
    Given a list of paired credit card transaction IDs where each pair represents money transfers between two accounts, write a function that identifies the number of bidirectional transaction patterns (where Account A has sent money to Account B, and Account B has also sent money to Account A). Each transaction pair should only be counted once, regardless of the order in which the transfers occurred.
    

    """
def count_bidirectional(test_list):
    """
    Given a list of paired credit card transaction IDs where each pair represents money transfers between two accounts, write a function that identifies the number of bidirectional transaction patterns (where Account A has sent money to Account B, and Account B has also sent money to Account A). Each transaction pair should only be counted once, regardless of the order in which the transfers occurred.
    

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