def fitness(individual, data):
    collisions = 0
    for item in individual:
        item_index = individual.index(item)
        for elem in individual:
            elem_index = individual.index(elem)
            if item_index != elem_index:
                if item - (elem_index - item_index) == elem \
                        or (item_index - elem_index) + item == elem:
                    collisions += 1
    return collisions
dataset/ETHPy150Open remiomosowon/pyeasyga/examples/8_queens.py/fitness/swapped operands of `-`