(nums, target)
| 12 | // Time O(n) - because we are using recursion, at most we will have n calls in the call-stack |
| 13 | // |
| 14 | const getSums = (nums, target) => { |
| 15 | const result = []; |
| 16 | backtrack(0, 0, [], nums, result, target); |
| 17 | return result; |
| 18 | }; |
| 19 | |
| 20 | function backtrack(idx, currSum, currSumArray, nums, result, target) { |
| 21 | if (idx > nums.length || currSum > target) { |
no test coverage detected