diff --git a/Java/Ch 17. Hard/Q17_25_Word_Rectangle/WordGroup.java b/Java/Ch 17. Hard/Q17_25_Word_Rectangle/WordGroup.java index adbd4bc6..7e39c58c 100644 --- a/Java/Ch 17. Hard/Q17_25_Word_Rectangle/WordGroup.java +++ b/Java/Ch 17. Hard/Q17_25_Word_Rectangle/WordGroup.java @@ -5,7 +5,7 @@ /* A container for a group of words of the same length. */ public class WordGroup { - private HashMap lookup = new HashMap(); + private HashSet lookup = new HashSet(); private ArrayList group = new ArrayList(); public WordGroup() { @@ -18,7 +18,7 @@ public boolean containsWord(String s) { public void addWord (String s) { group.add(s); - lookup.put(s, true); + lookup.put(s); } public int length() {