Cut an array into pieces; each piece costs a fixed k plus the number of its elements whose value repeats within it. Find the cheapest split.
Cut an array into pieces; each piece costs a fixed k plus the number of its elements whose value repeats within it. Find the cheapest split.
Opens with the full question.