MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / initOrder

Function initOrder

javascript/0054-spiral-matrix.js:234–240  ·  view source on GitHub ↗
(matrix, VISITED = 101)

Source from the content-addressed store, hash-verified

232};
233
234const 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
242var spiral = (matrix, order) => {
243 let [row, col, direction, changeDirection] = [0, 0, 0, 0];

Callers 1

spiralOrderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected