Skip to content

Commit e9ad3f0

Browse files
Added README.md file for Lexicographical Numbers
1 parent 581c409 commit e9ad3f0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

386-lexicographical-numbers/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<h2><a href="https://leetcode.com/problems/lexicographical-numbers">Lexicographical Numbers</a></h2> <img src='https://img.shields.io/badge/Difficulty-Medium-orange' alt='Difficulty: Medium' /><hr><p>Given an integer <code>n</code>, return all the numbers in the range <code>[1, n]</code> sorted in lexicographical order.</p>
2+
3+
<p>You must write an algorithm that runs in&nbsp;<code>O(n)</code>&nbsp;time and uses <code>O(1)</code> extra space.&nbsp;</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
<pre><strong>Input:</strong> n = 13
8+
<strong>Output:</strong> [1,10,11,12,13,2,3,4,5,6,7,8,9]
9+
</pre><p><strong class="example">Example 2:</strong></p>
10+
<pre><strong>Input:</strong> n = 2
11+
<strong>Output:</strong> [1,2]
12+
</pre>
13+
<p>&nbsp;</p>
14+
<p><strong>Constraints:</strong></p>
15+
16+
<ul>
17+
<li><code>1 &lt;= n &lt;= 5 * 10<sup>4</sup></code></li>
18+
</ul>

0 commit comments

Comments
 (0)