Loading problem…
Pick the best time and extra space complexity.
function canMakeSum(nums, target) { const dp = Array(target + 1).fill(false) dp[0] = true for (const num of nums) { for (let sum = target; sum >= num; sum--) { dp[sum] = dp[sum] || dp[sum - num] } } return dp[target] }