Problem 2296 · Hard
Keep the text left and right of the cursor in two stacks, so moving the cursor moves characters between them.
Open the interactive visualisation