
    Given a list of two-way delivery routes between distribution centers and delivery points, write a function that counts the number of unique bidirectional route pairs, where each pair represents the same path regardless of direction (e.g., route A→B is considered the same as B→A). Each route is represented as a tuple containing start and end locations, and the function should identify and count these equivalent route pairs to help optimize the delivery network planning.
    

    
def count_bidirectional(test_list):
    """
    Given a list of two-way delivery routes between distribution centers and delivery points, write a function that counts the number of unique bidirectional route pairs, where each pair represents the same path regardless of direction (e.g., route A→B is considered the same as B→A). Each route is represented as a tuple containing start and end locations, and the function should identify and count these equivalent route pairs to help optimize the delivery network planning.
    

    """
def count_bidirectional(test_list):
    """
    Given a list of two-way delivery routes between distribution centers and delivery points, write a function that counts the number of unique bidirectional route pairs, where each pair represents the same path regardless of direction (e.g., route A→B is considered the same as B→A). Each route is represented as a tuple containing start and end locations, and the function should identify and count these equivalent route pairs to help optimize the delivery network planning.
    

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