[C++] DP Shortest Solution (9 Lines)
Explanation : \nWe use the method of calculating maximum in contiguous subarray (Kadane\'s Algorithm) to compute the variable max0 which gives maximum contiguou
**Explanation :** \nWe use the method of calculating maximum in contiguous subarray (Kadane\'s Algorithm) to compute the variable max0 which gives maximum contiguous sum without removing any element\n\n**max0** : Maximum of contiguous subarray without removing any element\n**max1** : Maximum value of continuous subarray with atmost one removal of element.\n\n`max1` can be found out by :\n1) Taking previous computed `max1` value (which means value with atmost 1 removal of element )\n2) Taking previous value of `max0` value (which gives max value till one before the current element) and removing the current value.\n3) Starting out the array from the current element.\n\n`max0` can be found by using Kadane\'s Algorithm : \n[Note] : Here is the thorough and explanation of Kadane\'s Algorithm by @pferreiro  :  https://leetcode.com/problems/maximum-subarray/discuss/369797/kadanes-algorithm-with-detailed-explanation-and-example-python\n\n```\nint maximumSum(vector<int>& arr) {\n        int max1 = arr[0] , max0 = arr[0] , ans = arr[0];\n\t\tfor(int i=1;i<arr.size();i++){\n            max1 = max(max1+arr[i] , max(arr[i] , max0) );\n            max0 = max(max0+arr[i] , arr[i]);\n            ans = max(ans,max1);\n        }\n        return ans;\n    }\n```    \n
['Dynamic Programming', 'C']