ByteByteGo logo
menuProblems List

Maximum Subarray Sum

Medium

Given an array of integers, return the sum of the subarray with the largest sum.

Example:

Input: nums = [3, 1, -6, 2, -1, 4, -9]
Output: 5

Explanation: subarray [2, -1, 4] has the largest sum of 5.

Constraints:

  • The input array contains at least one element.

You can practice coding exercises online by logging into bytebytego.com on your laptop.