if current elements divides arr [ i ] and length is greater than the previous index , then insert the current element to the sequences LDS [ i ]
if ( ( arr [ i ] % arr [ j ] == 0 ) && ( LDS [ i ] . size ( ) < LDS [ j ] . size ( ) + 1 ) ) LDS [ i ] = LDS [ j ] ; }