Choose a contiguous subarray of nums, add its elements, and take the absolute value of the sum. Return the largest value obtainable this way. You may also choose the empty subarray, whose sum is zero.
Example 1:
Input: nums = [1,-1]
Output: 1Explanation: The single-entry subarrays have sums 1 and -1, both with absolute value 1. The entire array sums to 0.
Example 2:
Input: nums = [-10,2,3,-8,20]
Output: 20Explanation: The subarray [20] has absolute sum 20. No other contiguous subarray has a sum with greater absolute value.
Example 3:
Input: nums = [-4,-2,-3]
Output: 9Explanation: The entire array sums to -9, whose absolute value is 9. Taking fewer of these negative entries gives a smaller absolute sum.
Constraints:
1 <= nums.length <= 100000-10000 <= nums[i] <= 10000