MCPcopy
hub / github.com/careercup/ctci / isPartialOK

Method isPartialOK

java/Chapter 18/Question18_13/Rectangle.java:57–68  ·  view source on GitHub ↗
(int l, Trie trie)

Source from the content-addressed store, hash-verified

55 }
56
57 public boolean isPartialOK(int l, Trie trie) {
58 if (height == 0) {
59 return true;
60 }
61 for (int i = 0; i < l ; i++ ) {
62 String col = getColumn(i);
63 if (!trie.contains(col)) {
64 return false; // Invalid rectangle.
65 }
66 }
67 return true;
68 }
69
70 /* If the length of the argument s is consistent with that of this
71 * Rectangle object, then return a Rectangle whose matrix is constructed by

Callers 1

makePartialRectangleMethod · 0.80

Calls 2

getColumnMethod · 0.95
containsMethod · 0.45

Tested by

no test coverage detected