The n-queens problem is to find a way to select n entries in an nxn array so that no two entries are the same row, column, or diagonal. There is no solution for n < 4. For n = 4, the solutions is: . Q . . . . . Q Q . . . . . Q .