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

Function initTabu

javascript/0416-partition-equal-subset-sum.js:127–135  ·  view source on GitHub ↗
(nums, subSetSum)

Source from the content-addressed store, hash-verified

125};
126
127var initTabu = (nums, subSetSum) => {
128 const tabu = new Array(nums.length + 1)
129 .fill() /* Space O(N) */
130 .map(() => new Array(subSetSum + 1).fill(false)); /* Space O(M) */
131
132 tabu[0][0] = true; /* Space O(N * M) */
133
134 return tabu;
135};
136
137var search = (nums, subSetSum, tabu) => {
138 for (let numIndex = 1; numIndex <= nums.length; numIndex++) {

Callers 1

canPartitionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected