No adjacent equal digits
Your task
Count integers x in [1, N] (decimal, no leading zeros) such that no two ADJACENT digits of x are equal. Return the count. Constraints: 1 <= N <= 10**18. A direct loop is infeasible; use digit DP tracking the previous digit, a tight flag, and a started flag (to handle leading zeros / the length).
Examples
count_no_adjacent_equal(N: int) -> intExample 1
Input
count_no_adjacent_equal(12)Output
11