[Python3] bottom-up dp
\n\nclass Solution:\n    def maximumSum(self, arr: List[int]) -> int:\n        ans = d0 = d1 = -inf # delete 0 & delete 1 element\n        for x in arr:\n      
\n```\nclass Solution:\n    def maximumSum(self, arr: List[int]) -> int:\n        ans = d0 = d1 = -inf # delete 0 & delete 1 element\n        for x in arr:\n            d0, d1 = max(x, x + d0), max(d0, x + d1)\n            ans = max(ans, d0, d1)\n        return ans \n```
['Python3']