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

Method makeRectangle

java/Chapter 18/Question18_13/Question.java:57–66  ·  view source on GitHub ↗
(int length, int height)

Source from the content-addressed store, hash-verified

55 * cannot be formed.
56 */
57 private Rectangle makeRectangle(int length, int height) {
58 if (groupList[length - 1] == null || groupList[height - 1] == null) {
59 return null;
60 }
61 if (trieList[height - 1] == null) {
62 ArrayList<String> words = groupList[height - 1].getWords();
63 trieList[height - 1] = new Trie(words);
64 }
65 return makePartialRectangle(length, height, new Rectangle(length));
66 }
67
68
69 /* This function recursively tries to form a rectangle with words

Callers 1

maxRectangleMethod · 0.95

Calls 2

makePartialRectangleMethod · 0.95
getWordsMethod · 0.80

Tested by

no test coverage detected