leetcode地址,Java版代码:

1 class Solution {
2     public int[] printNumbers(int n) {
3         int end = (int)Math.pow(10, n) - 1;
4         int[] res = new int[end];
5         for(int i = 0; i < end; i++)
6             res[i] = i + 1;
7         return res;
8     }
9 }

 

posted on 2020-09-15 09:35  Sempron2800+  阅读(139)  评论(0编辑  收藏  举报