美文网首页
386. Lexicographical Numbers

386. Lexicographical Numbers

作者: 我是你的果果呀 | 来源:发表于2016-12-19 07:36 被阅读0次

    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

          本文链接:https://www.haomeiwen.com/subject/awnzmttx.html