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

Function search

javascript/0062-unique-paths.js:90–101  ·  view source on GitHub ↗
(row, col, tabu)

Source from the content-addressed store, hash-verified

88};
89
90var search = (row, col, tabu) => {
91 for (let _row = 1; _row < row; _row++) {
92 /* Time O(ROWS)*/
93 for (let _col = 1; _col < col; _col++) {
94 /* Time O(COLS)*/
95 const left = tabu[_row - 1][_col];
96 const right = tabu[_row][_col - 1];
97
98 tabu[_row][_col] = left + right; /* Space O(ROWS * COLS) */
99 }
100 }
101};
102
103var initTabu = (row, col) => {
104 const tabu = new Array(row)

Callers 1

uniquePathsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected