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

Function addLeft

javascript/0054-spiral-matrix.js:93–100  ·  view source on GitHub ↗
(matrix, top, bot, left, right, order)

Source from the content-addressed store, hash-verified

91};
92
93var addLeft = (matrix, top, bot, left, right, order) => {
94 for (let row = bot; top <= row; row--) {
95 /* Time O(ROWS) */
96 order.push(
97 matrix[row][left],
98 ); /* Ignore Auxilary Spsace O(ROWS * COLS) */
99 }
100};
101
102/**
103 * Matrix - Spiral Traversal Post Update

Callers 2

spiralOrderFunction · 0.85
traverseFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected