Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Set<String> getLinkedWords(String s, List<String> words) {
- Set<String> tmp = new HashSet<String>();
- for (int i = 0; i < words.size()-1; i++) {
- if (s.equals(words.get(i))) {
- tmp.add(words.get(i + 1));
- }
- }
- return tmp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement