Simplest Solution | Kadane Modification | C++
\nclass Solution {\npublic:\n    int maximumSum(vector<int>& arr) {\n        \n        int del_el=0;\n        int notdel_el=arr[0];\n        int so_far=arr[0];\
```\nclass Solution {\npublic:\n    int maximumSum(vector<int>& arr) {\n        \n        int del_el=0;\n        int notdel_el=arr[0];\n        int so_far=arr[0];\n        \n        int n=arr.size();\n        \n        for(int i=1;i<n;i++){\n            \n            del_el=max(notdel_el,del_el+arr[i]);\n            notdel_el=max(notdel_el+arr[i],arr[i]);\n            so_far=max(so_far,max(del_el,notdel_el));   \n            \n        }\n        \n        \n        return so_far;\n      \n        \n    }\n};\n```
['Dynamic Programming', 'C++']