반응형
배열 자르기 (JAVA)
import java.util.Arrays;
class Solution {
public int[] solution(int[] numbers, int num1, int num2) {
int[] answer = new int[numbers.length];
answer = Arrays.copyOfRange(numbers, num1, num2 +1);
return answer;
}
}
반응형
'알고리즘 > 프로그래머스:LV00' 카테고리의 다른 글
[LV00] 모스부호 (1) | 2023.04.27 |
---|---|
[LV00] 개미 군단 (0) | 2023.04.27 |
[LV00] 짝수의 합 (0) | 2023.04.24 |
[LV00] 양꼬치 (0) | 2023.04.18 |
[LV00] 각도기 (0) | 2023.04.18 |