length and step. Find every number with exactly length digits in which any two neighboring digits differ by exactly step (in absolute value).
Leading zeros are not allowed: something like 07 or 0707 does not count as a number of that length.
Return the numbers in any order.length=3, step=8 → [191, 808, 919]
Neighboring digits must differ by 8, which only allows the pairs 0–8 and 1–9. A number like 080 starts with a zero, so 808, 191 and 919 remain.
length=2, step=0 → [11, 22, 33, 44, 55, 66, 77, 88, 99]
Both digits are equal: 11, 22, ..., 99. 00 does not count, as it is not a two-digit number.
length ≤ 9step ≤ 9length=3, step=8
[191, 808, 919]
Run checks the first 3 tests in your browser. Submit checks all 63 tests on the server, hidden ones included.