@@ -0,0 +1,1161 @@
+package test;%0A%0A/**%0Aval dict = scala.io.Source.fromFile(%22words.txt%22).getLines.toSet%0Aclass A extends test.Test %7B%0A  override def lookup(word: String): Boolean = dict.contains(word)%0A%7D%0Aval a = new A()%0A%0Ascala%3E a.findWord(%22hellzou%22)%0Ares0: String = hello%0Ascala%3E a.findWord(%22abdkog%22)%0Ares3: String = dog%0Ascala%3E a.findWord(%22created%22)%0Ares4: String = created%0Ascala%3E a.findWord(%22createk%22)%0Ares5: String = create%0A*/%0Apublic abstract class Test %7B%0A  public String findWord(String word) %7B%0A    return findWord(word, new java.util.HashSet%3CString%3E());%0A  %7D%0A%0A  private String findWord(String word, java.util.HashSet%3CString%3E set) %7B%0A    if (word == null %7C%7C word.isEmpty() %7C%7C set.contains(word)) return null;%0A    if (lookup(word)) return word;%0A    set.add(word);%0A    String min = %22%22;%0A    for (int i = 0; i %3C word.length(); i++) %7B%0A      String res = findWord(word.substring(0, i) + word.substring(i + 1));%0A      if (res != null && res.length() %3E min.length()) %7B%0A        min = res;%0A      %7D%0A    %7D%0A    return min.isEmpty() ? null : min;%0A  %7D%0A%0A  // Provided dictionary method to look up a word%0A  // and return true, if word is part of dictionary%0A  public abstract boolean lookup(String word);%0A%7D%0A

add find-word