(row, rows, col, cols)
| 32 | }; |
| 33 | |
| 34 | var getNeighbors = (row, rows, col, cols) => |
| 35 | [ |
| 36 | [0, 1], |
| 37 | [0, -1], |
| 38 | [1, 0], |
| 39 | [-1, 0], |
| 40 | ] |
| 41 | .map(([_row, _col]) => [row + _row, col + _col]) |
| 42 | .filter( |
| 43 | ([_row, _col]) => |
| 44 | 0 <= _row && 0 <= _col && _row < rows && _col < cols, |
| 45 | ); |
| 46 | |
| 47 | /** |
| 48 | * https://leetcode.com/problems/walls-and-gates/ |
no outgoing calls
no test coverage detected