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

Function backTrackClose

javascript/0022-generate-parentheses.js:48–52  ·  view source on GitHub ↗
(n, combos, open, close, path)

Source from the content-addressed store, hash-verified

46};
47
48const backTrackClose = (n, combos, open, close, path) => {
49 path.push(')'); /* Space O(N) */
50 dfs(n, combos, open, close + 1, path); /* Time O(2^N) | Space O(2^N) */
51 path.pop();
52};
53
54/**
55 * BFS

Callers 1

dfsFunction · 0.85

Calls 3

dfsFunction · 0.70
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected