Problem 2547 · Hard

Minimum Cost to Split an Array

Each piece costs k plus the values that repeat inside it, so a table over split points finds the cheapest total.

Open the interactive visualisation