Problem 3170 · Medium

Lexicographically Minimum String After Removing Stars

Each star removes the smallest letter to its left, taking the rightmost copy on ties, which keeps the earlier letters in place.

Open the interactive visualisation