Medium Problems53. Maximum Subarray53. Maximum SubarrayLeetcodehttps://leetcode.com/problems/maximum-subarray/ What will be learned Get introduced to dynamic programming and the Kadane's algorithm. Solutionss Code 1function maxSubArray(nums: number[]): number { let maxSub = nums[0] let curSum = 0 for(let n of nums) { if (curSum < 0) { curSum = 0 } curSum += n maxSub = Math.max(maxSub, curSum) } return maxSub }; Video Solution Last Update: 12:08 - 16 April 2024ArrayDivide and ConquerDynamic ProgrammingPrevious49. Group AnagramsNext22. Generate ParenthesesOn this page