最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Leetcode386. Lexicographical Numbers

2023-01-19 12:53 作者:您是打尖兒還是住店呢  | 我要投稿

Given an integer?n, return all the numbers in the range?[1, n]?sorted in lexicographical order.

You must write an algorithm that runs in?O(n)?time and uses?O(1)?extra space.?

?

Example 1:

Input: n = 13Output: [1,10,11,12,13,2,3,4,5,6,7,8,9]

Example 2:

Input: n = 2Output: [1,2]

?

Constraints:

  • 1 <= n <= 5 * 104

沒想到能過,以為會(huì)超時(shí)的;空間反正是超了的;

Runtime18 ms

Beats

25.95%

Memory48.6 MB

Beats

54.73%

Click to check the distribution chart


Leetcode386. Lexicographical Numbers的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
光泽县| 林甸县| 嘉兴市| 资阳市| 梁平县| 新营市| 吉林市| 木兰县| 娄底市| 广宁县| 咸宁市| 林口县| 双辽市| 吉水县| 开封县| 徐闻县| 荥阳市| 白水县| 望都县| 容城县| 朝阳县| 南宫市| 英吉沙县| 博罗县| 筠连县| 新平| 仪陇县| 安吉县| 吉安县| 永嘉县| 邵阳市| 云浮市| 申扎县| 绥阳县| 侯马市| 周至县| 太湖县| 西昌市| 岳普湖县| 阿瓦提县| 宜章县|