<commit_before>public class Compute
{
    public static final int[] BASE_PATTERN = {0, 1, 0, -1};

    public Compute (boolean debug)
    {
        _debug = debug;
    }

    public int[] process (int[] input, int numberOfPhases)
    {
        int[] results = input;

        for (int i = 0; i < numberOfPhases; i++)
        {
            results = processPhase(input);
        }

        return results;
    }

    private int[] processPhase (int[] input)
    {
        int[] results = new int[input.length];
/*
        for (int i = 0; i < input.length; i++)
        {
            int[] basePattern = getBasePattern(i+1);

            for (int j = 0; i < basePattern.length; j++)
            {
                int[] work = new int[input.length];

                work[j] = input[j] * basePattern[j];

                System.out.println(input[j]+"*"+basePattern[j]);
            }
        }*/

        getBasePattern(1);

        return results;
    }

    /*
     * A reminder of the example ...
     * 
     * 10-1010-10
     * 01100-1-10
     * 00111000
     * 00011110
     * 00001111
     * 00000111
     * 00000011
     * 00000001
     * 
     * 10-1010-1010-1010-1  --> miss first digit [010-1010-1010-1]
     * 01100-1-1001100-1-1  --> miss first digit [001100-1-1]
     * 00111000-1-1-1000111000-1-1-1  --> miss first digit [000111000-1-1-1]
     * 00011110000-1-1-1-1000011110000-1-1-1-1  --> miss first digit [000011110000-1-1-1-1]
     * 00001111100000-1-1-1-1-1  --> miss first digit [000001111100000-1-1-1-1-1]
     */

    private final int[] getBasePattern (int phase)
    {
        int[] data = new int[(BASE_PATTERN.length*phase) -1];
        int basePtr = 0;
        int loop = 0;

        for (int i = 0; i < data.length; i++)
        {
            if (i == 0)
                loop = 1;

            data[i] = BASE_PATTERN[basePtr];

            //if (_debug)
                System.out.println("Base pattern entry "+i+" is "+data[i]);

            loop++;

            if (loop == phase)
            {
                loop = 0;
                basePtr++;
            }
        }

        return data;
    }

    private boolean _debug;
}<commit_msg>Update Compute.java<commit_after>public class Compute
{
    public static final int[] BASE_PATTERN = {0, 1, 0, -1};

    public static final int[] BASE_PATTERN_PHASE_1 = {1, 0, -1, 0, 1, 0, -1, 0};

    public Compute (boolean debug)
    {
        _debug = debug;
    }

    public int[] process (int[] input, int numberOfPhases)
    {
        int[] results = input;

        for (int i = 0; i < numberOfPhases; i++)
        {
            results = processPhase(input);
        }

        return results;
    }

    private int[] processPhase (int[] input)
    {
        int[] results = new int[input.length];
/*
        for (int i = 0; i < input.length; i++)
        {
            int[] basePattern = getBasePattern(i+1);

            for (int j = 0; i < basePattern.length; j++)
            {
                int[] work = new int[input.length];

                work[j] = input[j] * basePattern[j];

                System.out.println(input[j]+"*"+basePattern[j]);
            }
        }*/

        getBasePattern(1);

        return results;
    }

    /*
     * A reminder of the example ...
     * 
     * 10-1010-10
     * 01100-1-10
     * 00111000
     * 00011110
     * 00001111
     * 00000111
     * 00000011
     * 00000001
     * 
     * 10-1010-1010-1010-1  --> miss first digit [010-1010-1010-1]
     * 01100-1-1001100-1-1  --> miss first digit [001100-1-1]
     * 00111000-1-1-1000111000-1-1-1  --> miss first digit [000111000-1-1-1]
     * 00011110000-1-1-1-1000011110000-1-1-1-1  --> miss first digit [000011110000-1-1-1-1]
     * 00001111100000-1-1-1-1-1  --> miss first digit [000001111100000-1-1-1-1-1]
     */

    private final int[] getBasePattern (int phase)
    {
        int[] data = new int[(BASE_PATTERN.length*phase) -1];
        int basePtr = 0;
        int loop = 0;

        System.out.println("data size "+data.length);

        for (int i = 0; i < data.length; i++)
        {
            if (i == 0)
                loop = 1;

            data[i] = BASE_PATTERN[basePtr];

            //if (_debug)
                System.out.println("Base pattern entry "+i+" is "+data[i]);

            loop++;

            if (loop == phase)
            {
                loop = 0;
                basePtr++;
            }
        }

        return data;
    }

    private boolean _debug;
}
{'fraction_non_alphanumeric': 0.14164621904974348, 'fraction_numerical': 0.11398616997546286, 'mean_word_length': 1.4596818431157432, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2347033', 'n_tokens_mistral': 1861, 'n_tokens_neox': 1476, 'n_words': 347}