public void output(int[][] board) {

        List<String> temp = new ArrayList<>();
        for (int[] arr : board) {
            String str = "";
            for (int i : arr) {
                if (i == 1)
                    str += "Q";
                else
                    str += ".";
            }
            temp.add(str);
        }
        ans.add(temp);
    }