Problem 1209 · Medium

Remove All Adjacent Duplicates in String II

Repeatedly delete any run of k identical adjacent characters until no such run remains. The visual keeps a stack of character and count pairs that collapse once a run reaches k.

Open the interactive visualisation