This commit is contained in:
2025-09-15 21:12:04 +08:00
commit 3f58f483ff
144 changed files with 5298 additions and 0 deletions

18
25/06/386.go Normal file
View File

@@ -0,0 +1,18 @@
package main
func lexicalOrder(n int) []int {
ans := make([]int, n)
num := 1
for i := 0; i < n; i++ {
ans[i] = num
if num*10 <= n {
num *= 10
} else {
for num%10 == 9 || num+1 > n {
num /= 10
}
num++
}
}
return ans
}