Maximum Strength of K Disjoint Subarrays
Scan left to right with two states per subarray count, open or closed, and weight the j-th chosen subarray by its alternating sign and k - j + 1.
Scan left to right with two states per subarray count, open or closed, and weight the j-th chosen subarray by its alternating sign and k - j + 1.