Subsequences in an array with maximum difference - PrismoSkills
Problem: Find two contiguous subsequences in an array with maximum difference.
The subsequences may be overlapping.
Solution: This is an extended case of Kadane's algorithm.
Here we find max-subsequence using Kadane and then the min-subsequence using Kadane.
Desired result is the difference of sums of these two subsequeces.
Read full article from Subsequences in an array with maximum difference - PrismoSkills
Problem: Find two contiguous subsequences in an array with maximum difference.
The subsequences may be overlapping.
Solution: This is an extended case of Kadane's algorithm.
Here we find max-subsequence using Kadane and then the min-subsequence using Kadane.
Desired result is the difference of sums of these two subsequeces.
Read full article from Subsequences in an array with maximum difference - PrismoSkills