Recursive solution to the nqueens problem with isomorphic solution checking.