```
public List<Integer> lexicalOrder(int n) {
List<Integer> result = new ArrayList<>();
int count = 0;
int k = 1;
while (count < n) {
if (k > n) {
k /= 10;
while (k % 10 == 9) {
k = k /10;
}
k ++;
} else {
result.add(k);
count ++;
k *= 10;
}
}
return result;
}
```