IntStream1 [ 프로그래머스 ] 배열의 원소 삭제하기 문제 풀이 noneMatch : 모든 요소가 주어진 조건을 만족하지 않는지 검사할 때 사용된다. anyMatch : 최소 한개의 요소가 주어진 조건에 맞는지 검사할 때 사용된다. allMatch : 모든 요소들이 주어진 조건을 모두 만족하는가를 검사할 때 사용된다. 과정 import java.util.stream.IntStream; class Solution { public int[] solution(int[] arr, int[] delete_list) { return IntStream.of(arr) .filter(i -> IntStream.of(delete_list).noneMatch(j-> j==i)) .toArray(); } } noneMatch를 사용해서 delete_list의 원소랑 arr의 원.. 2024. 3. 1. 이전 1 다음