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,

  1. we want to get leftPart max, min.
  2. we want to get rightPart max, min

for each cutting position :

we update absValue = Math.max(Math.abs(max1 - min2), Math.abs(max2 - min1)).

results matching ""

    No results matching ""