Design a Text Editor with Undo and Redo
Undo and redo for a text editor: edits as commands that carry their own exact inverse, two stacks with a bounded history, keystrokes grouped into word-sized steps, typing over a selection as one compound step, a new edit clearing redo, and the measured cost of snapshots instead: 5,014,950 characters against 100.
01 · One keystroke
LLD-18 · Design a Text Editor with Undo and Redo
Type “Hello world”. Press Ctrl+Z.
The word disappears
Type Hello world, and press control Z.
0:00 / 13:27