Tap here to switch tabs
Problem
Submissions

Problem: Maximum Strength of K Disjoint Subarrays

Try to solve the Maximum Strength of K Disjoint Subarrays problem.

Statement

You are given an integer array nums of length nn and a positive odd integer k.

You need to choose k disjoint non-empty subarrays of nums, denoted by their index ranges [l1,r1],[l2,r2],…,[lk,rk][l_1, r_1], [l_2, r_2], \dots, [l_k, r_k], such that 0≤l1≤r1<l2≤r2<⋯<lk≤rk<n0 \leq l_1 \leq r_1 < l_2 \leq r_2 < \dots < l_k \leq r_k < n.

The strength of these k chosen subarrays is defined as:

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Strength of K Disjoint Subarrays

Try to solve the Maximum Strength of K Disjoint Subarrays problem.

Statement

You are given an integer array nums of length nn and a positive odd integer k.

You need to choose k disjoint non-empty subarrays of nums, denoted by their index ranges [l1,r1],[l2,r2],…,[lk,rk][l_1, r_1], [l_2, r_2], \dots, [l_k, r_k], such that 0≤l1≤r1<l2≤r2<⋯<lk≤rk<n0 \leq l_1 \leq r_1 < l_2 \leq r_2 < \dots < l_k \leq r_k < n.

The strength of these k chosen subarrays is defined as: