Subject[] generateSubjectGroup(int size, int[] code, int[] slot, String[] name){
        Subject[] s = new Subject[size];
        ArrayList<Subject> arr = new ArrayList<>(size);
        int t = 1;
        for(int i=0; i<size; i++){
            int k = (int)(size * Math.random());
            arr.add(new Subject(code[k % code.length], slot[k % slot.length], t, name[k % name.length]));
            s[i] = arr.get(i);
        }
        
        for(int i=0; i<size; i++){
            if(arr.get(i).getCode() == arr.get(size-1).getCode()){
                s[i].setGroup(t+1);
            } if(arr.get(i).getCode() == 0){
                s[i].setMaxStudents(0);
            }
        } return s;
    }