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

Function addRight

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

Source from the content-addressed store, hash-verified

73};
74
75var addRight = (matrix, top, bot, left, right, order) => {
76 for (let row = top; row <= bot; row++) {
77 /* Time O(ROWS) */
78 order.push(
79 matrix[row][right],
80 ); /* Ignore Auxilary Spsace O(ROWS * COLS) */
81 }
82};
83
84var addBot = (matrix, top, bot, left, right, order) => {
85 for (let col = right; left <= col; col--) {

Callers 2

spiralOrderFunction · 0.85
traverseFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected