(rows, cols)
| 29 | }; |
| 30 | |
| 31 | var getMatrix = (rows, cols) => |
| 32 | new Array(rows) |
| 33 | .fill() /* Time O(ROWS * COLS) | Space O(ROWS * COLS) */ |
| 34 | .map(() => new Array(cols).fill(false)); |
| 35 | |
| 36 | var searchRows = (heights, rows, cols, pacificReachable, atlanticReachable) => { |
| 37 | for (let row = 0; row < rows; row++) { |