Maximum Subarray

Given an integer array, find the subarray with the largest sum and return its sum.

Constraints

  • 1 <= nums.length <= 100000
  • -10000 <= nums[i] <= 10000
Saving… · 2 lines
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
Console

Click Run to execute sample tests.