@@ -0,0 +1,869 @@
+package uea;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0A/**%0A * Answer%0A */%0Apublic class Answer %7B%0A%0A  public static void main(String%5B%5D args) %7B%0A%0A    String%5B%5D list = %7B%22test.email+alex@leetcode.com%22,%0A      %22test.e.mail+bob.cathy@leetcode.com%22,%0A      %22testemail+david@lee.tcode.com%22%7D;%0A%0A    Solution sol = new Solution();%0A    int rt = sol.numUniqueEmails(list);%0A%0A    System.out.println(rt);%0A  %7D%0A%7D%0A%0Aclass Solution %7B%0A  public int numUniqueEmails(String%5B%5D emails) %7B%0A%0A    Set%3CString%3E set = new HashSet%3C%3E();%0A    for (String email : emails) %7B%0A%0A      int pos = email.indexOf(%22@%22);%0A      String local = email.substring(0, pos);%0A      String rest = email.substring(pos);%0A%0A      pos = local.indexOf(%22+%22);%0A      if(pos %3E= 0) %7B%0A        local = local.substring(0, pos);%0A      %7D%0A      local = local.replaceAll(%22.%22, %22%22);%0A      set.add(local + rest);%0A    %7D%0A    return set.size();%0A  %7D%0A%7D%0A

add unique-morse-code-words algorithm solution (java version)