Problem 2405 · Medium

Optimal Partition of String

Extend the current piece until a letter repeats, then start a new piece; this cut is the fewest possible.

Open the interactive visualisation