386. Lexicographical Numbers

Given an integern, return 1 -nin lexicographical order.

For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].

Please optimize your algorithm to use less time and space. The input size may be as large as 5,000,000.

要注意的是while 这段, 如果不加这段, 就会把234等直接漏掉, 19,20,     29,30,正确的应该是

19,2,20      29,3,30

386. Lexicographical Numbers_第1张图片

你可能感兴趣的:(386. Lexicographical Numbers)