@@ -0,0 +1,919 @@
+/*%0AGiven two arrays a%5B%5D and b%5B%5D of size n and m respectively. The task is to find union between these two arrays.%0A*/%0A%0A// Java program for the above approach%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Aclass Solution%7B%0A      static void printUnion(int%5B%5D a, int n, int%5B%5D b, int m)%7B%0A         HashSet%3CInteger%3E hs = new HashSet%3C%3E();%0A         for(int i = 0; i%3Cn; i++)%7B%0A            hs.add(a%5Bi%5D);%0A         %7D%0A         for(int i = 0; i%3Cm; i++)%7B%0A            hs.add(b%5Bi%5D);%0A         %7D%0A         return hs.size();%0A%09    %7D%0A%0A     public static void main (String%5B%5D args)%7B%0A        Scanner sc = new Scanner(System.in);%0A        int n = sc.nextInt();%0A        int m = sc.nextInt();%0A        int%5B%5D a = new int%5Bn%5D;%0A        int%5B%5D b = new int%5Bm%5D;%0A        for(int i = 0; i%3Cn; i++)%7B%0A           a%5Bi%5D=sc.nextInt();%0A        %7D%0A        for(int i = 0; i%3Cm; i++)%7B%0A           b%5Bi%5D=sc.nextInt();%0A        %7D%0A        System.out.println(printUnion(a,n,b,m));%0A     %7D%0A%7D%0A%0A

Create Union-of-two-arrays.java