# Question

Formatted question description: https://leetcode.ca/all/52.html

 Follow up for N-Queens problem.

Now, instead outputting board configurations, return the total number of distinct solutions.



# Algorithm

In fact, I think the order of the two Queens-question should be reversed. The previous question is a little more complicated than this one. There is no difference in essence between the two. Both have to be solved by backtracking. If you understand the previous question The idea of the question, this question only needs to make a small change, no need to ask for the specific queen’s pendulum, just need to increase the counter by one every time a solution is generated.

Java