Python solution using Recursion, Dynamic Programming (DP)
Intuition\n Describe your first thoughts on how to solve this problem. \ngiven a nums array, calculate the maximum total of subarray, \n- when split, start the 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\ngiven a nums array, calculate the maximum total of subarray, \n- when split, start the sign as +\n- when not split, flip the sign after each element.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nUsing recursive DP: \n - stop condition, when the cursor is larger than the array length\n - 2 choices: split and no_split: split reset the sign and no_split flip the sign\n\n# Code\n```\nclass Solution:\n    def maximumTotalCost(self, nums: List[int]) -> int:\n        l = len(nums)\n        @cache\n        def dp(i, sign):\n            if i >= l:\n                return 0\n            split =  sign * nums[i] + dp(i+1, 1)\n            no_split =  sign*(nums[i]) +  dp(i+1, -1*sign)\n            return max(split,no_split)\n\n        return dp(0, 1)\n```
['Dynamic Programming', 'Recursion', 'Python3']