An integer has sequential digits when each digit is exactly one more than the digit before it, like 123 or 6789. Given low and high, return a sorted list of every integer in [low, high] that has sequential digits.
An integer has sequential digits when each digit is exactly one more than the digit before it, like 123 or 6789. Given low and high, return a sorted list of every integer in [low, high] that has sequential digits.
Example 1:
Input: {"low":100,"high":300}
Output: [123,234]
Constraints:
10≤low≤high≤109
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"low":100,"high":300}
Every sequential-digit number is a contiguous slice of "123456789". Slide windows over it and keep the slices inside [100, 300].