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

Function dfs

javascript/0695-max-area-of-island.js:41–47  ·  view source on GitHub ↗
(grid, row, rows, col, cols, seen, area = 0)

Source from the content-addressed store, hash-verified

39};
40
41const dfs = (grid, row, rows, col, cols, seen, area = 0) => {
42 for (const [_row, _col] of getNeighbors(row, rows, col, cols)) {
43 area += getArea(grid, _row, rows, _col, cols, seen);
44 }
45
46 return area;
47};
48
49var getNeighbors = (row, rows, col, cols) =>
50 [

Callers 1

getAreaFunction · 0.70

Calls 2

getAreaFunction · 0.85
getNeighborsFunction · 0.70

Tested by

no test coverage detected