(row, rows, col, cols)
| 125 | }; |
| 126 | |
| 127 | var getNeighbors = (row, rows, col, cols) => |
| 128 | [ |
| 129 | [0, 1], |
| 130 | [0, -1], |
| 131 | [1, 0], |
| 132 | [-1, 0], |
| 133 | ] |
| 134 | .map(([_row, _col]) => [row + _row, col + _col]) |
| 135 | .filter( |
| 136 | ([_row, _col]) => |
| 137 | 0 <= _row && _row < rows && 0 <= _col && _col < cols, |
| 138 | ); |
| 139 | |
| 140 | /** |
| 141 | * https://leetcode.com/problems/pacific-atlantic-water-flow/ |
no outgoing calls
no test coverage detected