public int totalNQueens(int n) {
        if (n <= 0)
            return res;
        int[] occ = new int[n];
        Arrays.fill(occ, Integer.MIN_VALUE);
        totalNQueensDFS(0, n, occ);
        return res;
    }