text: class Solution(object):
      def maxSubArray(self, nums: List[int]) -> int:
          dp = [0]*len(nums)
          dp[0] = nums[0]
          max_num = nums[0]
          for i in range(1, len(nums)):
              dp[i] = max(dp[i-1]+nums[i], nums[i])
              if dp[i]>max_num: max_num = dp[i]
          return max_num
  