MCPcopy Index your code
hub / github.com/careercup/ctci / isComplete

Method isComplete

java/Chapter 18/Question18_13/Rectangle.java:42–55  ·  view source on GitHub ↗
(int l, int h, WordGroup groupList)

Source from the content-addressed store, hash-verified

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) {

Callers 1

makePartialRectangleMethod · 0.80

Calls 2

getColumnMethod · 0.95
containsWordMethod · 0.80

Tested by

no test coverage detected