The TransCompilator

Solved LeetCode program · 278 of 1,000

#0386 · Lexicographical Numbers

Medium Depth-First Search chunk-06.md

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.

Open in Playground Browse all 1,000 problems

Expected stdout

1
10
11
12
13
2
3
4
5
6
7
8
9