[Python] Kadane's Algorithm easy solution
Keep two array\'s one will have prefix sum ending at that index from start and one will have prefix sum ending at that index from end, using kadane\'s algorithm
Keep two array\'s one will have prefix sum ending at that index from start and one will have prefix sum ending at that index from end, using kadane\'s algorithm. For each i these array\'s will denote maximum subarray ending at i-1 and maximum subarray starting at i+1 so when you add these two values it will denote maximum subarray after deleting i.\n```\nclass Solution:\n    def maximumSum(self, arr: List[int]) -> int:\n        n = len(arr)\n        #maximum subarray starting from the last element i.e. backwards \n        prefix_sum_ending = [float(\'-inf\')]*n\n        #maximum subarray starting from the first element i.e forwards\n        prefix_sum_starting = [float(\'-inf\')]*n\n        prefix_sum_ending[n-1] = arr[n-1]\n        prefix_sum_starting[0] = arr[0]\n        \n        for i in range(1,n):\n            prefix_sum_starting[i] = max(prefix_sum_starting[i-1]+arr[i], arr[i])\n        for i in range(n-2,-1,-1):\n            prefix_sum_ending[i] = max(prefix_sum_ending[i+1]+arr[i], arr[i])\n           \n        max_without_deletion = max(prefix_sum_starting)\n        max_with_deletion = float(\'-inf\')\n        for i in range(1,n-1):\n            max_with_deletion = max(max_with_deletion, prefix_sum_starting[i-1]+prefix_sum_ending[i+1])\n            \n        return max(max_without_deletion, max_with_deletion)\n```
['Python', 'Python3']