[Python] DP
delete[i] stores the biggest sum of the substring ends at i (at most delete one)\nnotDelete[i] stores the biggest sum of the substring ends at i (no deletion)\n
delete[i] stores the biggest sum of the substring ends at i (at most delete one)\nnotDelete[i] stores the biggest sum of the substring ends at i (no deletion)\n\nfor the ith element\n1. delete it: deleted[i] = notDelete[i-1]\n2. not delete it: deleted[i] = deleted[i] + arr[i]\n\nif we found the current sum is less than the element itself (previous sum is less than 0)\ndelete[i] = notDelete[i] = arr[i]\n\n```\nclass Solution:\n    def maximumSum(self, arr: List[int]) -> int:\n        deleted = notDeleted = 0\n        res = float(\'-inf\')\n        for i,a in enumerate(arr):\n            deleted = max(deleted + a,a)\n            if i > 0:\n                deleted = max(deleted,notDeleted)\n            notDeleted = max(notDeleted + a,a)\n            res = max(res, deleted)\n        return res\n```
[]