iterate through array and find end index of LIS and its Size
for ( int i = 1 ; i < n ; i ++ ) { hash [ A [ i ] ] = hash [ A [ i ] - 1 ] + 1 ; if ( LIS_size < hash [ A [ i ] ] ) { LIS_size = hash [ A [ i ] ] ; LIS_index = A [ i ] ; } }