xAI interview question

They asked me the Text Editor LeetCode question with Undo/Redo