Solved NQueen problem.