def _get_wrong_positions(solution):
    """
    Returns the positions of queens that are incompatible.

    Args:
        solution (np.array): Row position of each queen in their respective column.

    Returns:
        set: Wrong queen positions.
    """
    wrong = set()
    for i in range(len(solution)):
        for j in range(i + 1, len(solution)):
            if solution[i] == solution[j]:
                wrong.update([i, j])
            else:
                if abs(solution[i] - solution[j]) == abs(i - j):
                    wrong.update([i, j])
    return wrong