Problem 2296 · Hard

Design a Text Editor

Keep the text left and right of the cursor in two stacks, so moving the cursor moves characters between them.

Open the interactive visualisation