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

Function addBot

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

Source from the content-addressed store, hash-verified

82};
83
84var addBot = (matrix, top, bot, left, right, order) => {
85 for (let col = right; left <= col; col--) {
86 /* Time O(COLS) */
87 order.push(
88 matrix[bot][col],
89 ); /* Ignore Auxilary Spsace O(ROWS * COLS) */
90 }
91};
92
93var addLeft = (matrix, top, bot, left, right, order) => {
94 for (let row = bot; top <= row; row--) {

Callers 2

spiralOrderFunction · 0.85
traverseFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected