public static List<String> findWord(String s, String t) {
HashSet<String> missingWords = new HashSet<>();
String[] words = s.split(" ");
for(int i=0; i < words.length; i++) {
if (!t.contains(words[i])) {
missingWords.add(words[i]);
}
}
List<String> ans = new ArrayList<String>();
for (String str: missingWords) {
ans.add(str);
}
return ans;
}
public static List<String> findWord(String s, String t) {
HashSet<String> missingWords = new HashSet<>();
String[] words = s.split(" ");
for(int i=0; i < words.length; i++) {
if (!t.contains(words[i])) {
missingWords.add(words[i]);
}
}
List<String> ans = new ArrayList<String>();
for (String str: missingWords) {
ans.add(str);
}
return ans;
}