Given an integer array nums, return the maximum possible sum of a non-empty contiguous subarray. The subarray must contain at least one element, and the function should return an integer.
Example 1:
Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
Output: 6
Explanation: The subarray [4,-1,2,1] has sum 6.
Example 2:
Input: nums = [1]
Output: 1
Explanation: The only subarray is [1], so the answer is 1.
1 <= len(nums) <= 10^5-10^4 <= nums[i] <= 10^4