(int n)
| 3 | int res = 0; |
| 4 | |
| 5 | public int NQueens(int n) |
| 6 | { |
| 7 | dfs(0, new HashSet<int>(), new HashSet<int>(), new HashSet<int>(), n); |
| 8 | |
| 9 | return res; |
| 10 | } |
| 11 | |
| 12 | private void dfs(int r, ISet<int> diagonalsSet, ISet<int> antiDiagonalsSet, ISet<int> colsSet, int n) |
| 13 | { |