human
Maximum sum subarray removing at most one element | Method returns maximum sum of all subarray where removing one element is also allowed.
Maximum sum subarrays in forward and backward directions.
Initialize current max and max so far ..
calculating maximum sum subarrays in forward direction.
storing current maximum till ith , in forward array.
calculating maximum sum subarrays in backward direction.
storing current maximum from ith , in backward array.
Initializing final ans by max_so_far so that , case when no element is removed to get max sum subarray is also handled.
choosing maximum ignoring ith element.
Driver code to test above methods"
Solution in Python:

=====
Give me a code to maximum sum subarray removing at most one element and the other steps required?
assistant
#Here is code to maximum sum subarray removing at most one element and the other steps required.
 def maxSumSubarrayRemovingOneEle ( arr , n ) :
	fw = [ 0 for k in range ( n ) ]
	bw = [ 0 for k in range ( n ) ]
	cur_max , max_so_far = arr [ 0 ] , arr [ 0 ]
	fw [ 0 ] = cur_max
	for i in range ( 1 , n ) :
		cur_max = max ( arr [ i ] , cur_max + arr [ i ] )
		max_so_far = max ( max_so_far , cur_max )
		fw [ i ] = cur_max
	cur_max = max_so_far = bw [ n - 1 ] = arr [ n - 1 ]
	i = n - 2
	while i >= 0 :
		cur_max = max ( arr [ i ] , cur_max + arr [ i ] )
		max_so_far = max ( max_so_far , cur_max )
		bw [ i ] = cur_max
		i -= 1
	fans = max_so_far
	for i in range ( 1 , n - 1 ) :
		fans = max ( fans , fw [ i - 1 ] + bw [ i + 1 ] )
	return fans
arr = [ - 2 , - 3 , 4 , - 1 , - 2 , 1 , 5 , - 3 ]
n = len ( arr )
print maxSumSubarrayRemovingOneEle ( arr , n )