(matrix, order)
| 240 | }; |
| 241 | |
| 242 | var spiral = (matrix, order) => { |
| 243 | let [row, col, direction, changeDirection] = [0, 0, 0, 0]; |
| 244 | |
| 245 | while (changeDirection < 2) { |
| 246 | /* Time O(ROWS * COLS) | Ignore Auxilary Spsace O(ROWS * COLS) */ |
| 247 | [row, col, direction, changeDirection] = |
| 248 | /* Time O(ROWS * COLS) | Ignore Auxilary Spsace O(ROWS * COLS) */ |
| 249 | getPointers(matrix, row, col, direction, changeDirection, order); |
| 250 | } |
| 251 | }; |
| 252 | |
| 253 | const getPointers = (matrix, row, col, direction, changeDirection, order) => { |
| 254 | [row, col, direction, changeDirection] = |
no test coverage detected