We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9ad3f0 commit 6f92970Copy full SHA for 6f92970
386-lexicographical-numbers/lexicographical-numbers.py
@@ -0,0 +1,5 @@
1
+class Solution:
2
+ def lexicalOrder(self, n: int) -> List[int]:
3
+ nums = list(range(1, n+1))
4
+ nums.sort(key = lambda x : str(x))
5
+ return nums
0 commit comments