Solved LeetCode program · 278 of 1,000
#0386 · Lexicographical Numbers
Original English source
Keep a shared ceiling of 13.
To walk from value (a whole number). If value is more than ceiling, return. Show value.
For every digit from 0 to 9.
The next is value times 10 plus digit. If next is at most ceiling, walk from next.
For every start from 1 to 9.
Walk from start.
Expected stdout
1 10 11 12 13 2 3 4 5 6 7 8 9