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.