
    Given a list of flagged social media post pairs where each pair indicates two posts sharing similar harmful content characteristics, write a function that determines the total number of unique harmful content connections, considering that a connection between post A and post B is equivalent to a connection between post B and post A. For example, if post pairs (1,2) and (2,1) represent the same harmful content relationship, they should be counted only once in the final tally.
    

    
def count_bidirectional(test_list):
    """
    Given a list of flagged social media post pairs where each pair indicates two posts sharing similar harmful content characteristics, write a function that determines the total number of unique harmful content connections, considering that a connection between post A and post B is equivalent to a connection between post B and post A. For example, if post pairs (1,2) and (2,1) represent the same harmful content relationship, they should be counted only once in the final tally.
    

    """
def count_bidirectional(test_list):
    """
    Given a list of flagged social media post pairs where each pair indicates two posts sharing similar harmful content characteristics, write a function that determines the total number of unique harmful content connections, considering that a connection between post A and post B is equivalent to a connection between post B and post A. For example, if post pairs (1,2) and (2,1) represent the same harmful content relationship, they should be counted only once in the final tally.
    

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