无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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ó)家法律
尉氏县| 平罗县| 金坛市| 当阳市| 遵化市| 资兴市| 栾城县| 南宁市| 巧家县| 隆林| 双城市| 华蓥市| 利辛县| 兰西县| 连城县| 肇东市| 马尔康县| 池州市| 尚志市| 石泉县| 泗洪县| 奉贤区| 买车| 海林市| 东海县| 哈密市| 乌鲁木齐县| 龙陵县| 景泰县| 蒲城县| 双辽市| 吉水县| 宕昌县| 弋阳县| 济阳县| 石城县| 托里县| 黄龙县| 石台县| 新河县| 龙胜|