Problem 3563 · Hard

Lexicographically Smallest String After Adjacent Removals

Find which stretches of the string can be fully erased, then pick the smallest result with a suffix dynamic program.

Open the interactive visualisation