Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
How can Kadane's Algorithm help us?
If you convert all the numbers at odd indices to the negative version of that number, the problem simplifies to finding the maximum subarray sum.
However, this strategy needs you to start each subarray at an even index.
Do the same except converting all the numbers at even indices to the negative version of that number.