class Solution {
public int[][] solution(int[] num_list, int n) {
// result의 배열대로 배열을 저장한다.
int[][] answer = new int[num_list.length / n][n];
// [1, 2, 3, 4, 5, 6, 7, 8] 2 [[1, 2], [3, 4], [5, 6], [7, 8]]
// num_list.length = 8
for (int i = 0; i < num_list.length; i++) {
//[0][0] = 1, [0][1] = 2 임으로 num_list.length만큼 for문을 돌린뒤,
// 2차원 배열 저장
answer[i / n][i % n] = num_list[i];
}
return answer;
}
}