rewrite leetcode nQueens II