Coding Challenge · INTERMEDIATE
A text editor allows users to type characters and supports an undo feature. Each time a character is typed, it is added to the document. When 'UNDO' is issued, the most recently typed character is removed. Given a sequence of operations, return the final document as a string after all operations are performed.