Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
What if we asked for maximum sum, not absolute sum?
It's a standard problem that can be solved by Kadane's algorithm.
The key idea is the max absolute sum will be either the max sum or the min sum.
So just run kadane twice, once calculating the max sum and once calculating the min sum.