(int l, int h, WordGroup groupList)
| 40 | } |
| 41 | |
| 42 | public boolean isComplete(int l, int h, WordGroup groupList) { |
| 43 | // Check if we have formed a complete rectangle. |
| 44 | if (height == h) { |
| 45 | // Check if each column is a word in the dictionary. |
| 46 | for (int i = 0; i < l; i++) { |
| 47 | String col = getColumn(i); |
| 48 | if (!groupList.containsWord(col)) { |
| 49 | return false; // Invalid rectangle. |
| 50 | } |
| 51 | } |
| 52 | return true; // Valid Rectangle! |
| 53 | } |
| 54 | return false; |
| 55 | } |
| 56 | |
| 57 | public boolean isPartialOK(int l, Trie trie) { |
| 58 | if (height == 0) { |
no test coverage detected