Tap here to switch tabs
Problem
Submissions

Problem: Divide an Array Into Subarrays With Minimum Cost I

Divide an Array Into Subarrays With Minimum Cost I asks you to split an integer array into three contiguous, nonempty parts and return the smallest possible sum of their first elements.

Statement

You are given an array of integers nums of length nn.

You need to partition nums into 33 contiguous, non empty, and disjoint subarrays. The cost of a partition is defined as the sum of the first element of each of the 33 subarrays.

Return the minimum possible total cost of partitioning the array.

Constraints:

  • 3≤n≤503 \leq n \leq 50

  • 1≤1 \leq nums[i] ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Divide an Array Into Subarrays With Minimum Cost I

Divide an Array Into Subarrays With Minimum Cost I asks you to split an integer array into three contiguous, nonempty parts and return the smallest possible sum of their first elements.

Statement

You are given an array of integers nums of length nn.

You need to partition nums into 33 contiguous, non empty, and disjoint subarrays. The cost of a partition is defined as the sum of the first element of each of the 33 subarrays.

Return the minimum possible total cost of partitioning the array.

Constraints:

  • 3≤n≤503 \leq n \leq 50

  • 1≤1 \leq nums[i] ≤50\leq 50