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

Function initMemo

javascript/0494-target-sum.js:57–62  ·  view source on GitHub ↗
(nums, total)

Source from the content-addressed store, hash-verified

55};
56
57var initMemo = (nums, total) =>
58 new Array(nums.length)
59 .fill() /* Time O(N) | Space O(N) */
60 .map(() =>
61 new Array((total + 1) << 1).fill(null),
62 ); /* Time O(M) | Space O(M) */
63
64const calculate = (
65 nums,

Callers 1

calculateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected