-Code
import java.util.*;
import java.util.stream.Collectors;
class Solution {
public int[] solution(int[] arr, int[] delete_list) {
List<Integer> answer = Arrays.stream(arr).boxed().collect(Collectors.toList());
for (int n : delete_list) answer.remove((Integer) n);
return answer.stream().mapToInt(Integer::intValue).toArray();
}
}
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
[프로그래머스/Java] 부분 문자열 (0) | 2025.02.12 |
---|---|
[프로그래머스/Java] 공백으로 구분하기 1 (0) | 2025.02.12 |
[프로그래머스/Java] 조건에 맞게 수열 변환하기 3 (0) | 2025.02.12 |
[프로그래머스/Java] 주사위 게임 1 (0) | 2025.02.12 |
[프로그래머스/Java] 간단한 식 계산하기 (0) | 2025.02.12 |