import java.util.ArrayList;

class Mutant {
    int dna_len;
    int counter;

    Mutant(){
    }

    public static void main(String[] args){
        String[] dna = {"ATGCG", "CAGTGC", "TTATGA", "AGAAGG", "CCCCTA", "TCACTG"};
        Mutant mutant = new Mutant();
        mutant.isMutant(dna);
    }

    private boolean isMutant(String[] dna){
        ArrayList<char[]> array = new ArrayList<>();

        int len;
        int max_width = 0;
        int max_height;
        counter = 0;
        dna_len = 4;
        max_height = dna.length;
        char[] vertical = new char[max_height];

        //first convert to char[] and get max_length
        for (String i: dna){
            array.add(i.toCharArray());

            len = i.length();
            if(max_width < len){
                max_width = len;
            }
        }


        //fill the matrix
        char[][] matrix = new char[max_height][max_width];
        for(int i=0; i<max_height; i++){
            char[] tmp = array.get(i);

            //check for horizontal cases
            check_horizontal(tmp);
            if(counter > 1){
                System.out.println(counter);
                return true;
            }

            int tmp_len = tmp.length;
            for(int j=0; j<max_width; j++){
                //ensure index, and set empty in other case
                char elem = (j < tmp_len) ? tmp[j] : 0;

                matrix[i][j] = elem;
            }
        }

        //iterate vertical and check
        for(int j=0; j<max_width; j++){
            char[] tmp = new char[max_height];
            for(int i=0; i<max_height; i++){
                tmp[i] = matrix[i][j];
            }

            check_horizontal(tmp);

            if(counter > 1){
                System.out.println(counter);
                return true;
            }
        }

        System.out.println(counter);
        return false;
    }

    private void check_horizontal(char[] item){
        int l = item.length;
        char flag;

        if(l < dna_len){
            return;
        }

        for(int i=0; i<l-dna_len+1; i++){
            flag = item[i];

            //check first and last elements, iterate 
            for(int j=i+dna_len-1; j>i; j--){
                if(flag != item[j]){
                    break;
                }

                if(j > i+1){
                    continue;
                }

                counter++;
                if(counter > 1){
                    return;
                }

                i += dna_len -1;
            }
        }
    }
}


@@ -166,63 +166,63 @@
 = %7B%22
-ATGCG%22, %22CAGTGC%22, %22TTATGA%22, %22AGAAGG%22, %22CCCCTA%22, %22TCACTG
+000M0%22, %2200M000%22, %220M0000%22, %22M00000%22, %22000000%22, %22000000
 %22%7D;%0A
@@ -1831,32 +1831,845 @@
    %7D%0A        %7D%0A%0A
+        //iterate in diagonal top-left to bottom-right (%5C)%0A        char%5B%5D tmp = new char%5Bdna_len%5D;%0A        for(int i=0; i %3C= max_width - dna_len; i++)%7B%0A            for(int j=0; j %3C= max_height - dna_len; j++)%7B%0A                //create diagonal array%0A                for(int k=0; k%3Cdna_len; k++)%7B%0A                    tmp%5Bk%5D = matrix%5Bi+k%5D%5Bj+k%5D;%0A                %7D%0A                check_horizontal(tmp);%0A            %7D %0A        %7D%0A%0A        //iterate in diagonal bottom-left to top-right (/)%0A        for(int i=0; i %3C= max_width - dna_len; i++)%7B%0A            for(int j=max_height-1; j %3E= dna_len-1; j--)%7B%0A                //create diagonal array%0A%0A                for(int k=0; k%3Cdna_len; k++)%7B%0A                    tmp%5Bk%5D = matrix%5Bi+k%5D%5Bj-k%5D;%0A                %7D%0A                check_horizontal(tmp);%0A            %7D %0A        %7D%0A%0A
         System.o
@@ -3302,32 +3302,84 @@
              %7D%0A%0A
+                //move the window to the next chunk%0A
                 

check all posible dna_len diagonals