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

Function uniquePaths

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

Source from the content-addressed store, hash-verified

7 * @return {number}
8 */
9var uniquePaths = (row, col) => {
10 const isBaseCase = row == 1 || col == 1;
11 if (isBaseCase) return 1;
12
13 return dfs(row, col); /* Time O(2^N) | Space O(HEIGHT) */
14};
15
16var dfs = (row, col) => {
17 const left = uniquePaths(row - 1, col); /* Time O(2^N) | Space O(HEIGHT) */

Callers 1

dfsFunction · 0.70

Calls 4

getMemoFunction · 0.85
dfsFunction · 0.70
initTabuFunction · 0.70
searchFunction · 0.70

Tested by

no test coverage detected