function c = conflicts(x)

%%returns the numnber of conflicts for the n-queen problem where x
%%represents the positions of the queens on the checkboard

n = size(x,2);
c = 0;

for i = 1:n
    for j=i+1:n
        if x(i)-x(j)==0
            c = c+1;
        else if abs(x(i) - x(j)) == abs (i-j)
            c = c+1;
            end
        end
    end
end

