Inspired by the solution 179 Largest Number, here comes my solution, but I got a TLE when n == 23489. Can someone tell me if this way of thinking may work? Thanks a lot.

```
public List<Integer> lexicalOrder(int n) {
List<Integer> ret = new ArrayList<Integer>();
if(n < 1) return ret;
Integer[] nums = new Integer[n];
for(int i = 0; i < n; i ++){
nums[i] = i + 1;
}
Comparator<Integer> comp = new Comparator<Integer>(){
@Override
public int compare(Integer num1, Integer num2){
String str1 = String.valueOf(num1);
String str2 = String.valueOf(num2);
return str1.compareTo(str2);
}
};
Arrays.sort(nums, comp);
for(Integer num : nums){
ret.add(num);
}
return ret;
}
```