1746. Maximum Subarray Sum After One Operation
Description
**Input:** nums = [2,-1,-4,-3]
**Output:** 17
**Explanation:** You can perform the operation on index 2 (0-indexed) to make nums = [2,-1,**16**,-3]. Now, the maximum subarray sum is 2 + -1 + 16 = 17.
**Input:** nums = [1,-1,1,1,-1,-1,1]
**Output:** 4
**Explanation:** You can perform the operation on index 1 (0-indexed) to make nums = [1,**1**,1,1,-1,-1,1]. Now, the maximum subarray sum is 1 + 1 + 1 + 1 = 4.ac
Last updated