A stepping number has adjacent digits differing by exactly 1. Count stepping numbers in . State: .
Transition: if , valid. Handle leading zeros: before placing the first non-zero digit, any digit is valid. Track flag. Examples: 123, 321, 12321 are stepping. , , are not. The stepping constraint only involves adjacent digits. Track the last digit placed to check the constraint.