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

Function getSum

javascript/0416-partition-equal-subset-sum.js:20–24  ·  view source on GitHub ↗
(nums, sum = 0)

Source from the content-addressed store, hash-verified

18};
19
20var getSum = (nums, sum = 0) => {
21 for (const num of nums) sum += num; /* Time O(N) */
22
23 return sum;
24};
25
26var dfs = (nums, index, subSetSum) => {
27 const isBaseCase1 = subSetSum === 0;

Callers 1

canPartitionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected