class Solution {
public int[] solution(int[] num_list, int n) {
n--;
int[] answer = new int[num_list.length-n];
for(int i=0; i<num_list.length-n; i++) {
answer[i] = num_list[i+n];
}
return answer;
}
// 타인의 코드
// return Arrays.copyOfRange(numList, n - 1, numList.length);
}
'Study with me > 프로그래머스 L0 마스터하기' 카테고리의 다른 글
프로그래머스 - L0 특정한문자를대문자로바꾸기 (0) | 2023.12.06 |
---|---|
프로그래머스 - L0 글자이어붙여문자열만들기 (0) | 2023.12.06 |
프로그래머스 - L0 길이에따른연산 (0) | 2023.12.03 |
프로그래머스 - L0 더크게합치기 // String ↔ int (0) | 2023.12.03 |
프로그래머스 - L0 수조작하기1 // String → char sequence (0) | 2023.12.02 |