
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use DP. Try to cut the array into d non-empty sub-arrays. Try all possible cuts for the array.
Use dp[i][j] where DP states are i the index of the last cut and j the number of remaining cuts. Complexity is O(n * n * d).