Tap here to switch tabs
Problem
Submissions

Problem: Minimum Partition Score

Try to solve the Minimum Partition Score problem.

Statement

You are given an integer array nums and an integer k.

You need to partition nums into k contiguous non empty subarrays. The score of a subarray with sum SS is defined as S×(S+1)2\frac{S \times (S + 1)}{2}.

The total score of a partition is the sum of the scores of all its subarrays.

Return the minimum total score possible after partitioning nums into k subarrays.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤104\leq 10^4

  • 1≤1 \leq k ≤\leq nums.length

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Partition Score

Try to solve the Minimum Partition Score problem.

Statement

You are given an integer array nums and an integer k.

You need to partition nums into k contiguous non empty subarrays. The score of a subarray with sum SS is defined as S×(S+1)2\frac{S \times (S + 1)}{2}.

The total score of a partition is the sum of the scores of all its subarrays.

Return the minimum total score possible after partitioning nums into k subarrays.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤104\leq 10^4

  • 1≤1 \leq k ≤\leq nums.length