package leetcode;

/**
 * https://leetcode.com/problems/unique-morse-code-words/
 */
public class Problem804 {
    public int uniqueMorseRepresentations(String[] words) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem804 prob = new Problem804();
        System.out.println(prob.uniqueMorseRepresentations(new String[]{"gin", "zen", "gig", "msg"})); // 2
    }
}

@@ -12,16 +12,65 @@
 tcode;%0A%0A
+import java.util.HashSet;%0Aimport java.util.Set;%0A%0A
 /**%0A * h
@@ -225,237 +225,570 @@
     
-// TODO%0A        return 0;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem804 prob = new Problem804();%0A        System.out.println(prob.uniqueMorseRepresentations(new String%5B%5D%7B%22gin%22, %22zen%22, %22gig%22, %22msg%22%7D)); // 2
+String%5B%5D morse = new String%5B%5D%7B%0A            %22.-%22, %22-...%22, %22-.-.%22, %22-..%22, %22.%22, %22..-.%22, %22--.%22, %22....%22, %22..%22, %22.---%22, %22-.-%22, %22.-..%22,%0A            %22--%22, %22-.%22, %22---%22, %22.--.%22, %22--.-%22, %22.-.%22, %22...%22, %22-%22, %22..-%22, %22...-%22, %22.--%22, %22-..-%22,%0A            %22-.--%22, %22--..%22%7D;%0A        Set%3CString%3E set = new HashSet%3C%3E();%0A        for (String word : words) %7B%0A            StringBuilder sb = new StringBuilder();%0A            for (char c : word.toCharArray()) %7B%0A                sb.append(morse%5Bc - 'a'%5D);%0A            %7D%0A            set.add(sb.toString());%0A        %7D%0A        return set.size();
 %0A   

Solve probem 804