(row, rows, col, cols)
| 46 | }; |
| 47 | |
| 48 | var getNeighbors = (row, rows, col, cols) => |
| 49 | [ |
| 50 | [0, 1], |
| 51 | [0, -1], |
| 52 | [1, 0], |
| 53 | [-1, 0], |
| 54 | ] |
| 55 | .map(([_row, _col]) => [row + _row, col + _col]) |
| 56 | .filter( |
| 57 | ([_row, _col]) => |
| 58 | 0 <= _row && _row < rows && 0 <= _col && _col < cols, |
| 59 | ); |
| 60 | |
| 61 | /** |
| 62 | * DP - Top Down |
no outgoing calls
no test coverage detected