Notice
Recent Posts
Recent Comments
Link
forest_moon
2차원으로 만들기 본문
코드
class Solution {
public int[][] solution(int[] num_list, int n) {
int[][] answer = new int[num_list.length/n][n];
int count = 0;
for(int i = 0; i< num_list.length/n; i++) {
for (int j = 0; j < n; j++) {
answer[i][j] = num_list[count];
count++;
}
}
return answer;
}
}