@@ -0,0 +1,841 @@
+public int commonTwo(String%5B%5D a, String%5B%5D b) %7B%0A  // Sets cannot contain duplicates%0A  Set%3CString%3E commonItems = new HashSet%3CString%3E();%0A%0A  int aIndex = 0; int bIndex = 0;%0A%0A  while (aIndex %3C a.length && bIndex %3C b.length) %7B%0A    // Compare the current string in A to the current string in B%0A    int compared = a%5BaIndex%5D.compareTo(b%5BbIndex%5D);%0A    // If A comes before B, go to the next item in A%0A    if (compared %3C 0) aIndex++;%0A    // If B comes before A, go to the next item in B%0A    else if (compared %3E 0) bIndex++;%0A    // If the two strings are equal, add the match to the commonItems Set and move%0A    // to the next item in both arrays.%0A    else %7B%0A      commonItems.add(a%5BaIndex%5D);%0A      aIndex++;%0A      bIndex++;%0A    %7D%0A  %7D%0A%0A  // The set will not contain duplicates by nature, so just take the size of the set.%0A  return commonItems.size();%0A%7D%0A

Create commonTwo.java