DP with Array
Max Distinct Subarray Sum
Given an array, find two subarray, where their absolute value of subarray A and subarray B is maximum.
Prediction:
How to divide two part ?
for every possible cutting position,
- we want to get leftPart max, min.
- we want to get rightPart max, min
for each cutting position :
we update absValue = Math.max(Math.abs(max1 - min2), Math.abs(max2 - min1)).