Optimal k-Segment Partition Minimizing Weighted Variance Sum

Given a sorted array, find a partition point c such that the weighted sum of variances on each side of c is minimized. Additionally, find k-1 partition points to divide the array into k segments with ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: