private String[] toSolution(ArrayDeque<Integer> columns) {
            int n = columns.size();
            String[] s = new String[n];
            int row = 0;
            for (int column : columns) {
                String line = "";
                for (int i = 0; i < n; i++) {
                    if (i != column) {
                        line += '.';
                    } else {
                        line += 'Q';
                    }
                }
                s[row++] = line;
            }
            return s;
        }