Adjacent digits are different
if ( j != k ) : NEW_LINE INDENT dp [ i ] [ j ] = dp [ i ] [ j ] + ( dp [ i - 1 ] [ k ] + ( cnt [ i - 1 ] [ k ] * j ) % MOD ) % MOD ; NEW_LINE dp [ i ] [ j ] %= MOD ; NEW_LINE DEDENT