Total cases = 10!.
Considering case when one block( 3 digits) is same as 1st code sequence= 8!..
Multiply by 2 because 3 digits can be reversed in a block and they'll still be adjacent..
Total blocks= 8. Hence total cases=8*2*8!..
[Above expression also contains cases when more than 3 digits are same w.r.t 1st code..]
Therefore ans= 10!-(2*8*8!)