Skip to content

Files

Latest commit

author
Shuo
Feb 16, 2022
ce6b544 · Feb 16, 2022

History

History

maximum-alternating-subarray-sum

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 16, 2022

< Previous                  Next >

Related Topics

[Array] [Dynamic Programming]

Hints

Hint 1 How can Kadane's Algorithm help us?
Hint 2 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.
Hint 3 However, this strategy needs you to start each subarray at an even index.
Hint 4 Do the same except converting all the numbers at even indices to the negative version of that number.