MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / solve

Function solve

javascript/0130-surrounded-regions.js:7–11  ·  view source on GitHub ↗
(board)

Source from the content-addressed store, hash-verified

5 * @return {void} Do not return anything, modify board in-place instead.
6 */
7var solve = function solve(board) {
8 searchRows(board); /* Time O(ROWS * COLS) | Space O(ROWS * COLS) */
9 searchCols(board); /* Time O(ROWS * COLS) | Space O(ROWS * COLS) */
10 searchGrid(board); /* Time O(ROWS * COLS) | Space O(ROWS * COLS) */
11};
12
13var searchRows = (board) => {
14 const [rows, cols] = [board.length, board[0].length];

Callers

nothing calls this directly

Calls 4

searchRowsFunction · 0.70
searchColsFunction · 0.70
searchGridFunction · 0.70
bfsFunction · 0.70

Tested by

no test coverage detected