Maximum Sum of Two Non-Overlapping Subarrays
Example
Input:
A = [0,6,5,2,2,5,1,9,4], L = 1, M = 2
Output:
20
Explanation:
One choice of subarrays is [9] with length 1, and [6,5] with length 2.Input:
A = [3,8,1,3,2,1,8,9,0], L = 3, M = 2
Output:
29
Explanation:
One choice of subarrays is
[3,8,1] with length 3, and [8,9] with length 2.Note
Code
Last updated