Problem 1047 · Easy

Remove All Adjacent Duplicates In String

Repeatedly remove adjacent equal letters until none remain. A stack shows each incoming letter either cancelling the top or being pushed onto the reduced prefix.

Open the interactive visualisation