2
def maximumSum(self, arr: List[int]) -> int:6
dpLeft = [-(10**4) - 1 for _ in range(n)]10
dpLeft[i] = max(arr[i], dpLeft[i - 1] + arr[i])12
dpRight = [-(10**4) - 1 for _ in range(n)]16
dpRight[j] = max(arr[j], dpRight[j + 1] + arr[j])22
curr_maxi_with = dpRight[k] + dpLeft[k] - arr[k]25
curr_maxi_without = dpRight[k + 1]27
curr_maxi_without = dpLeft[k - 1]29
if dpLeft[k - 1] >= 0 and dpRight[k + 1] >= 0:30
curr_maxi_without = dpRight[k + 1] + dpLeft[k - 1]32
curr_maxi_without = max(dpLeft[k - 1], dpRight[k + 1])34
maxi = max(maxi, curr_maxi_without, curr_maxi_with)