MCPcopy Index your code
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / explore

Function explore

graphs/boggle-board.js:33–46  ·  view source on GitHub ↗
(row, col, board, visited, trieNode, finalWords)

Source from the content-addressed store, hash-verified

31}
32
33function explore(row, col, board, visited, trieNode, finalWords) {
34 if (visited[row][col]) return;
35 const letter = board[row][col];
36 if (!trieNode.hasOwnProperty(letter)) return;
37 visited[row][col] = true;
38 trieNode = trieNode[letter];
39 if ("*" in trieNode) finalWords[trieNode["*"]] = true;
40 const neighbors = getNeighbors(row, col, board);
41
42 for (const neighbor of neighbors) {
43 explore(neighbor[0], neighbor[1], board, visited, trieNode, finalWords);
44 }
45 visited[row][col] = false;
46}
47
48function getNeighbors(row, col, board) {
49 const neighbors = [];

Callers 1

boggleBoardFunction · 0.85

Calls 1

getNeighborsFunction · 0.70

Tested by

no test coverage detected