• + 1 comment
    ArrayList[] sequenceArray=new ArrayList[length];
    for (int j = 0; j <length; j++) {
                sequenceArray[j]=new ArrayList<Integer>();
    }
    

    where length is the first int read from the input.