You are given an integer array nums (values may be negative). Walk through it from left to right and, for each element, either take it (adding it to your total) or skip it, but you may never skip two consecutive elements. Taking every element is allowed, and the very first element may be skipped.
Return the maximum total you can collect.
Input: nums = [3,-1,4]
Output: 7
Explanation: Take 3, skip -1, take 4.
Input: nums = [-5,-6,-7]
Output: -6
Explanation: Skip -5, take -6, skip -7. Skipping both -5 and -7 is fine because they are not consecutive. Any other pattern takes at least two elements.
Input: nums = [-2,5,-1,-1,3]
Output: 7
Explanation: Skip -2, take 5, skip the first -1, then the second -1 must be taken, take 3: 5 - 1 + 3 = 7.
nums.length ≤105nums[i] ≤109