Find digits of each element , then find length of subsequence for each digit and then find local maximum
for ( i = 1 ; i < n ; i ++ ) { tmp = arr [ i ] ; locMax = 1 ; for ( let x = 0 ; x < 10 ; x ++ ) cnt [ x ] = 0 ;