Notion Labs Interview Question

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