private void placeQueen(ArrayList<String[]> result, int[] tag, int row, int n) {
        //when finish placing all the Q, build the list
        if (row == n) {
            String[] temp = new String[n];
            for (int i = 0; i < n; i++) {
                String point = new String();
                for (int j = 0; j < n; j++) {
                    if (j == tag[i]) {
                        point = point + "Q";
                    } else {
                        point = point + ".";
                    }
                }
                temp[i] = point;
            }
            result.add(temp);
            return;
        }
        //place the Q, row by row, column by column
        for (int col = 0; col < n; col++) {
            //tag for back track
            tag[row] = col;
            if (canPlace(tag, row)) {
                placeQueen(result, tag, row + 1, n);
            }
        }
    }