<commit_before>package ru.samsu.mj.board;

import ru.samsu.mj.collection.BoardCollection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class BoardGenerator {
    public static BoardCollection generateByDimension(int n) {
        List<Board> list = new ArrayList<>();
        int[] board = new int[n];
        Arrays.fill(board, -1);
        generateByDimension(list, board, new boolean[n], n, 0);
        BoardCollection boardCollection = BoardCollection.valueOf(list);
        return boardCollection;
    }

    private static void generateByDimension(List<Board> list, int[] current, boolean[] occCols, int n, int i) {
        if (i == n) {
            Board board = Board.valueOf(current);
            list.add(board);
            return;
        }

        generateByDimension(list, current, occCols, n, 1 + i);

        int max = n / 2 - Math.abs(n / 2 - i);
        for (int j = 0; j < max; j++) {
            int d = n - 1 - i - j;
            int i2 = i + d, j2 = j + d;

            if (occCols[j] || occCols[j2])
                continue;

            occCols[j] = occCols[j2] = true;
            current[i] = j;
            current[i2] = j2;
            generateByDimension(list, current, occCols, n, 1 + i);
            occCols[j] = occCols[j2] = false;
            current[i] = -1;
            current[i2] = -1;
        }
    }
}
<commit_msg>Fix access modifier.<commit_after>package ru.samsu.mj.board;

import ru.samsu.mj.collection.BoardCollection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class BoardGenerator {
    public static BoardCollection generateByDimension(int n) {
        List<Board> list = new ArrayList<>();
        int[] board = new int[n];
        Arrays.fill(board, -1);
        generateByDimension(list, board, new boolean[n], n, 0);
        BoardCollection boardCollection = BoardCollection.valueOf(list);
        return boardCollection;
    }

    private static void generateByDimension(List<Board> list, int[] current, boolean[] occCols, int n, int i) {
        if (i == n) {
            Board board = Board.valueOf(current);
            list.add(board);
            return;
        }

        generateByDimension(list, current, occCols, n, 1 + i);

        int max = n / 2 - Math.abs(n / 2 - i);
        for (int j = 0; j < max; j++) {
            int d = n - 1 - i - j;
            int i2 = i + d, j2 = j + d;

            if (occCols[j] || occCols[j2])
                continue;

            occCols[j] = occCols[j2] = true;
            current[i] = j;
            current[i2] = j2;
            generateByDimension(list, current, occCols, n, 1 + i);
            occCols[j] = occCols[j2] = false;
            current[i] = -1;
            current[i2] = -1;
        }
    }
}

{'fraction_non_alphanumeric': 0.12867383512544803, 'fraction_numerical': 0.012903225806451613, 'mean_word_length': 1.910323253388947, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7315370', 'n_tokens_mistral': 907, 'n_tokens_neox': 891, 'n_words': 235}