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.
Each piece costs k plus the values that repeat inside it, so a table over split points finds the cheapest total.