(matrix, VISITED = 101)
| 232 | }; |
| 233 | |
| 234 | const initOrder = (matrix, VISITED = 101) => { |
| 235 | const order = [matrix[0][0]]; /* Ignore Auxilary Spsace O(ROWS * COLS) */ |
| 236 | |
| 237 | matrix[0][0] = VISITED; /* Ignore Auxilary Spsace O(ROWS * COLS) */ |
| 238 | |
| 239 | return order; |
| 240 | }; |
| 241 | |
| 242 | var spiral = (matrix, order) => { |
| 243 | let [row, col, direction, changeDirection] = [0, 0, 0, 0]; |