Kubernate

Java 8 # Intercestion

 import java.util.List;

import java.util.stream.Collectors;


public class Intersection {

    public static List<Integer> findIntersection(List<Integer> list1, List<Integer> list2) {

        return list1.stream()

                .distinct()

                .filter(list2::contains)

                .collect(Collectors.toList());

    }

}

No comments:

Post a Comment

Spring Boot - Bean LifeCycle

 Here is a clear, step-by-step lifecycle of a Spring Boot application , explained in a simple + interview-ready way. 🔄 Spring Boot Applica...

Kubernate