Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- WordPress
- 지옥같은git
- wordpress블로그
- 리스트합집합
- 널포인터에러
- list중복제거
- Spring
- postgresql13
- xml
- 리스트차집합
- lightsail
- ansible
- 중복제거
- anymatch메서드
- 권한정책
- awsconsole
- instance생성
- 리스트비교
- mybatis
- 두개리스트비교
- Annotation
- 리스트교집합
- hashset
- AWS
- route53
- db
- PostgreSQL
- peer authentication 에러
- enum
- Java
Archives
- Today
- Total
Anyway

List A = {1,2,3}List B = {2,3,4} 이렇게 두 개의 리스트가 있을 때 내가 구하고 싶은 것은 A의 차집합니다. // A 리스트의 차집합을 구하는 함수 생성public static List findDifference(List A, List B) { Set setB = new HashSet(B); return A.stream() .filter(element -> !setB.contains(element)) .collect(Collectors.toList());} stream()을 사용한 것은 A의 요소를 stream으로 처리하여 B에 없는 요소만 필터링하기 위해서다. >>> 추가로 [합집합]에 대하여List union = new ArrayList..
카테고리 없음
2025. 1. 3. 09:58