Given sub - sequences of the array
ArrayList < ArrayList < Integer > > subseqs = new ArrayList < ArrayList < Integer > > ( ) ; subseqs . add ( new ArrayList < Integer > ( Arrays . asList ( 9 , 1 , 2 , 8 , 3 ) ) ) ; subseqs . add ( new ArrayList < Integer > ( Arrays . asList ( 6 , 1 , 2 ) ) ) ; subseqs . add ( new ArrayList < Integer > ( Arrays . asList ( 9 , 6 , 3 , 4 ) ) ) ; subseqs . add ( new ArrayList < Integer > ( Arrays . asList ( 5 , 2 , 7 ) ) ) ; subseqs . add ( new ArrayList < Integer > ( Arrays . asList ( 0 , 9 , 5 , 4 ) ) ) ;