6 of 6 Replaced rot90 with flip to save a byte, but found a bug.

# Octave, 57706751 52 bytes

Saved 1 byte using flip instead of rot90 thanks to @LuisMendo, but found a bug on the 1x1 case

@(A)all(sum([A A' (d=@spdiags)(A) d(flip(A))],1)==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the matrix flipped horizontally to get the antidiagonals.

Now take the sum of each column of the concatenated matrix and make sure each column is exactly 1.

Sample run on ideone.

 answered Mar 9 '17 at 0:10 beaker 2,34911 gold badge55 silver badges1616 bronze badges