1186. Maximum Subarray Sum with One Deletion
Description
**Input:** arr = [1,-2,0,3]
**Output:** 4
**Explanation:** Because we can choose [1, -2, 0, 3] and drop -2, thus the subarray [1, 0, 3] becomes the maximum value.**Input:** arr = [1,-2,-2,3]
**Output:** 3
**Explanation:** We just choose [3] and it's the maximum sum.**Input:** arr = [-1,-1,-1,-1]
**Output:** -1
**Explanation:** The final subarray needs to be non-empty. You can't choose [-1] and delete -1 from it, then get an empty subarray to make the sum equals to 0.ac
Last updated