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

Function checkNeighbors

javascript/0778-swim-in-rising-water.js:36–42  ·  view source on GitHub ↗
(grid, row, rows, col, cols, seen, minHeap)

Source from the content-addressed store, hash-verified

34};
35
36var checkNeighbors = (grid, row, rows, col, cols, seen, minHeap) => {
37 for (const [_row, _col] of getNeighbors(row, rows, col, cols)) {
38 if (seen.has(grid[_row][_col])) continue;
39
40 minHeap.enqueue([_row, _col], grid[_row][_col]);
41 }
42};
43
44const getNeighbors = (row, rows, col, cols) =>
45 [

Callers 1

getTimeFunction · 0.70

Calls 1

getNeighborsFunction · 0.70

Tested by

no test coverage detected