No adjacent digits

Write codeHard35 minGoogle style

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) -> int
Example 1
Inputcount_no_adjacent_equal(22)
Output21