[Python3] 6 Lines Simple DP O(N) Time O(1) Space
one(delete one) = max(delete me,  delete someone before)\nzero(delete zero) = max(just me,  me + all before)\n```\nclass Solution:\n    def maximumSum(self, arr
one(delete one) = max(delete me,  delete someone before)\nzero(delete zero) = max(just me,  me + all before)\n```\nclass Solution:\n    def maximumSum(self, arr: List[int]) -> int:\n        res = zero = one = -inf\n        for x in arr:\n            one = max(zero, x + one)\n            zero = max(x, x + zero)\n            res = max(res, one, zero)\n        return res
[]