Pregunta de entrevista de Notion Labs

Given a text editor class, write the code for undoing and redoing text operations.