Problem 1531 · Hard

String Compression II

Decide character by character whether to delete or keep it, memoizing on the current run so each run length is priced once.

Open the interactive visualisation