Find common elements in two string arrays java. Eliminating duplicate characters in a String.

Find common elements in two string arrays java. Auxiliary Space: O(n) where n is the length of the string.