Solution: Maximum Subarray

Let's solve the Maximum Subarray problem using the Dynamic Programming pattern.

Statement

Given an integer array, nums, find the contiguous subarray that has the largest sum and return its sum.

Note: A subarray is a contiguous part of an array that contains at least one number.

Constraints:

  • 11 \leq nums.length 105\leq 10^5 ...