题目 Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 分析 N皇后问题,同LeetCode 51 N-Queens,只不过,此题要求给出问题的合理解个数,而无需给出具体分布. 只需在上题的基础上,稍加修改,只计数便可达到要求,此题采用另一种求解N皇后问题的方法: 用一个一位数组来存放当前皇后的状态…