Problem 3561 · Medium

Resulting String After Adjacent Removals

A stack removes each adjacent pair of circularly consecutive letters the moment it forms, which matches removing the leftmost pair each time.

Open the interactive visualisation