386. Lexicographical Numbers


https://leetcode.com/problems/lexicographical-numbers/


Runtime: 101 ms, faster than 8.33% of Go online submissions for Lexicographical Numbers.
Memory Usage: 9.5 MB, less than 8.33% of Go online submissions for Lexicographical Numbers.


```go
import (
	"fmt"
	"sort"
	"strconv"
)

func lexicalOrder(n int) []int {
	//5:29
	list := make([]string, 0)
	for i := 1; i <= n; i++ {
		list = append(list, strconv.Itoa(i))
	}
    sort.Strings(list)

	result := make([]int, 0)
	for _, i := range list {
		value, _ := strconv.Atoi(i)
		result = append(result, value)
	}
	return result
	//5:42
}
```
