Split Array Largest Sum

Problem Overview

  • Split an integer array into k non-empty contiguous subarrays to minimize the sum of each subarray's maximum value.
  • Input: int[] nums and int k; Output: an int equal to the minimal possible sum of maxima over the k subarrays.
  • Subarrays must be contiguous and non-empty; k indicates exactly how many parts to form.
  • Real-world context: partitioning workloads or batches to balance peak costs.
  • A common coding interview problem and interview question focused on array partitioning.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: