You are given an integer array nums.
You can perform an operation where you delete two elements from nums by choosing one of the following options:
Delete the first two elements of nums.
Delete the last two elements of nums.
Delete the first element and the last element of nums.
The score of the operation is the sum of the two deleted elements.
Return the maximum score that can be obtained from performing this operation.
Constraints:
nums.length
nums[i]
You are given an integer array nums.
You can perform an operation where you delete two elements from nums by choosing one of the following options:
Delete the first two elements of nums.
Delete the last two elements of nums.
Delete the first element and the last element of nums.
The score of the operation is the sum of the two deleted elements.
Return the maximum score that can be obtained from performing this operation.
Constraints:
nums.length
nums[i]