package leetcode;

import java.util.Arrays;
import java.util.List;

/**
 * https://leetcode.com/problems/word-break-ii/
 */
public class Problem140 {
    public List<String> wordBreak(String s, List<String> wordDict) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem140 prob = new Problem140();
        System.out.println(prob.wordBreak("catsanddog",
            Arrays.asList("cat", "cats", "and", "sand", "dog"))); // ["cats and dog", "cat sand dog"]
    }
}

@@ -54,19 +54,67 @@
 va.util.
-Lis
+HashSet;%0Aimport java.util.List;%0Aimport java.util.Se
 t;%0A%0A/**%0A
@@ -256,24 +256,24 @@
 wordDict) %7B%0A
-
         // T
@@ -276,16 +276,139 @@
 // TODO%0A
+        Set%3CString%3E words = new HashSet%3C%3E();%0A        for (String word : wordDict) %7B%0A            words.add(word);%0A        %7D%0A
         

Update problem 140