TS algorithm for nqueens problem works