create and build an array that stores minimum sums of subarrays that lie in arr [ i + 1. . . n - 1 ]
rightMin = [ 0 for i in range ( n ) ] NEW_LINE maxRightSubArraySum ( invertArr , n - 1 , rightMin ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT rightMin [ i ] = - rightMin [ i ] NEW_LINE DEDENT result = - 2147483648 NEW_LINE for i in range ( n - 1 ) : NEW_LINE