import java.util.*;
class Solution {
public int[] solution(int[] num_list, int n) {
List<Integer> list = new ArrayList();
for(int i = 0; i <num_list.length ; i++){
if(i % n == 0 ){
list.add(num_list[i]);
}
}
int[] answer = new int [list.size()];
for(int i= 0; i <list.size();i++) {
answer[i] = list.get(i);
}
return answer;
}
}
(1) list 선언 후 만약 인덱스 % n == 0 이라면 리스트에 num_list[인덱스] 값 추가
(2) 리스트값 배열에 삽입
2Lv 풀다 쉬는중..