No adjacent digits
Your task
Given a non-negative integer n, count how many integers x with 0 <= x <= n have NO two adjacent digits equal in their usual base-10 representation (e.g. 11 and 122 are invalid; 121 and 5 are valid; single-digit numbers including 0 are valid). 0 <= n <= 10^9. Return the count.
Examples
count_no_adjacent_equal(n: int) -> intExample 1
Input
count_no_adjacent_equal(22)Output
21