Pcjmy opened this issue 2 years ago · 1 comments
var maxSubArray = function(nums) { let dp = [] ; dp[0]=nums[0] let max = nums[0]; for(let i =1; i<nums.length ; i++){ dp[i]=Math.max(dp[i-1]+nums[i],nums[i]) max=Math.max(dp[i],max) } return max; };