LintCode/Maximum Subarry II; Maximum Subarray Difference

Problem Summary

Problem 1: Maximum Subarray II

Given an array of integers, find two non-overlapping subarrays which have the largest sum. The subarray should contain at least one number and the numbers in each subarray should be contiguous.

Problem 2: Maximum Subarray Difference

Given an array of integers, find two non-overlapping subarrays A and B, such that |SUM(A) - SUM(B)| is the largest.
The subarray should contain at least one number and the numbers in each subarray should be contiguous.
Calculate the largest difference.

Read More