diff --git a/DataStructures/HashMap/Hashing/Intersection b/DataStructures/HashMap/Hashing/Intersection new file mode 100644 index 000000000..cfe1f74d7 --- /dev/null +++ b/DataStructures/HashMap/Hashing/Intersection @@ -0,0 +1,37 @@ +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Scanner; +import java.util.Set; + +public class Intersection { + + public static ArrayList Main(int arr[],int arr2[]) { + HashMap hmap=new HashMap<>(); + HashMap hmap2=new HashMap<>(); + for(int i=0;i res=new ArrayList<>(); + for(int i=0;i0) { + int val=hmap.get(arr2[i]); + hmap.put(arr2[i],val-1); + res.add(arr2[i]); + } + + } + return res; + } + public Intersection() { + + } + + + +}